Posted by : Chris London in (Programming, Tutorial)

Anonymous Functions and Closure in PHP

Tagged Under : , , ,

It’s about time that PHP joined the band wagon of anonymous functions. Anonymous functions, also known as closures, are functions with no specified name. These functions are stored in variables and can be passed around. Anonymous functions have been in other programming languages like Javascript, so if you know Javascript then anonymous functions are nothing new.

Read the rest of this entry »

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 »