Monthly Archives: May 2010

PHP Functions: realpath()

Watch Out – Hard Code Perhaps every developer knows that hard coded paths are no good! The code’s good to be flexible and extensible, but what the way to achieve that? In a typically developed application you’re completely sure the … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , | Leave a comment

Check YouTube Video Existence with Zend_Gdata_YouTube

The Video Has Been Removed?! Have you ever seen the famous message on YouTube: “This video has been removed by the user.”, but what if you’re trying to grab that video via the Zend_Gdata_YouTube? That can happen when you’re reading … Continue reading

Posted in micro tutorial, PHP, zend framework | Tagged , , , , , , , , , , , , , , , | Leave a comment

PHP Associative Arrays Coding Style

No PHP programmer writes code without arrays. Sound strange, but as many programmers there are, as many ways to format the array notation there are. My advice is to rely on a defined standard. I personally use the Zend Framework’s … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , , , , , , , | 5 Comments

PHP: The Array Element Doesn’t Exist – Suppress the Warnings

What’s the problem? If you code PHP from couple of hours you are probably familiar with the following problem: 1 2 3 4 5 6 7 8 9 <?php   error_reporting(E_ALL);   $arr = array();   echo $arr[3];   ?> … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , , | Leave a comment

Using rand() for a CAPTCHA!

What if you have to add a simple CAPTCHA for a web form asking the user to sum two numbers. Will you prefer to use rand() to generate those two numbers? Some may say this is too predictable!

Posted in PHP | Tagged , , , , , | 1 Comment