PHP Code Snippets
This is a collection of PHP snippets that are really useful for PHP developers. If you know any code snippet you may post/share it for others here: Post a Snippet. The most popular of them will be added to this list. We keep adding the new snippets all the time!
Get Remote IP Address in PHP Detect Browser with PHP Unzip a Zip File HTTP Redirection in PHP SEO Friendly Links Highlight Specific Words in a Phrase Get Short URLs for Twitter Send Mail using Mail Function Highlight PHP Code Remove Last Character from String Base64 Encode and Decode String Automatic Password Generation Get File Path Data Convert Seconds into Time String Get File Extension List Directory Contents Parsing XML using PHP Download File with a Speed Limit Remove Duplicates in Array Using Gravatars in Your Script POST Request by Socket Connection Get Country By IP Address Validating IP Address in PHP Creating and Parsing JSON Data in PHP Change Site Language Automatically Change First Image Properties Compress Mltiple CSS Files Calculate Age Using a Birth Date Count Files Recursive new Cut Image using PHP new WhoIs Query in PHP new Calculate Full Size of Directory new