Category: PHP

Past few months, I have seen a lot of people asking for sites that teach php from the ground up. So, here are a couple of places you can go…

Read More Useful PHP Resources

PHP

This is modified and expanded version of http://net.tutsplus.com/articles/news/how-to-read-an-rss-feed-with-php-screencast. <?php function shorten($string, $length=65){ $truncated_string = ”; foreach (explode(‘ ‘, $string) as $word){ if (strlen($truncated_string) >= $length){ return $truncated_string; } $truncated_string .=…

Read More Pull any RSS feed, Show link, Title and Date and Shorten Date and Title

PHP

This class can be used to get information of the country of an IP address. It takes an IP address and queries MySQL database to determine the country associated with…

Read More IP2Country PHP Class

PHP

MYSQL PHP

PHP

This is actually a neat trick. Here is the example: <?php if (isset($username[5])) { // The username is at least six characters long. } ?> When you treat strings as…

Read More Use isset() Instead of strlen()

PHP

This tip accidentally stumbles upon a useful practice, which is to always initialize variables before you use them. Consider a conditional statement that determines whether a user is an administrator…

Read More Shortcut the else in PHP

PHP

PHP

PHP

PHP Web Security