Posted by : Chris London in (Programming, Tutorial)

Do While vs While

Tagged Under : , , , ,

When I started programming I only learned about do ... while statements and I didn’t know about while statements. There are some times when my code would’ve been a lot cleaner if I had known about while statements. To save you all the trouble of what I had to go through I’m writing this post. For those of you who already know the difference between while and do ... while I have included a little-known trick that may interest you. Just skip on down to the bottom.

Read the rest of this entry »

Posted by : Chris London in (Programming, Tutorial)

Organizing PHP Includes with Autoload

Tagged Under : , , , ,

Since PHP5 was released, PHP programmers have been blessed with a decent support of object-oriented programming. With this ability many programmers have used classes in many if not all of their projects. A very common practice for OO programmers is to place each class in an includes folder. There have been many times when I have seen a config file full of includes and/or requires. They will include every class in their includes folder whether or not they use it in a particular script. This causes many unnecessary includes.

Read the rest of this entry »