Blog

PHP – Problem with issetor()

In case you haven’t seen it before, issetor() is a quick and dirty way of getting a value from a variable that may or may not be defined: One unfortunate side-effect that most people are unaware of is that even though you can use this function without needing to worry Read more…

By Chris West, ago
Blog

PHP – XML To JSON Proxy

Today I was looking for a way to easily pull in RSS feed data from Apple Trailers onto my site via AJAX. At first I was thinking about using jQuery to do it but then I got thinking about how cool it would be to have a PHP script that Read more…

By Chris West, ago
Blog

PHP – Foreach By Reference

Today I was writing some code in which I wanted to modify the values of an array within a for-loop. The obvious solution would be to use the key to modify the value but there is actually another way of doing it: The above code will actually go through the Read more…

By Chris West, ago
Blog

Here Document

Something that you may not know about PHP and many other languages is that it provides heredoc syntax to build strings. What does this mean? Check out the following: The above puts the following into the $myCode variable as a string: You can use this syntax in many different languages: Read more…

By Chris West, ago