Godaddy 4GH Web Hosting Sucks

Recently, I found Godaddy.com was advertising a new hosting package called “4GH Web hosting” and it was claimed to be the “4th generation hosting”, which…
Read More

PHP Cheat Sheet: Regular Expression

1. preg_match(): if (preg_match(“/php/i”, “PHP is the web scripting language of choice.”)) {     echo “A match was found.”; } Note: $matches[0]will contain the text…
Read More

PHP Cheat Sheet: Working with Directories

1. Retrieving a Path’s Filename: $path = ‘/home/www/data/users.txt’; $file_nm = basename($path);  // “users.txt” $file_nm_1 = basename($path, “.txt”);  // “users”, no extension. 2. Retrieving a Path’s…
Read More

PHP Cheat Sheet: File Handling

1. Checking Whether a File Exists: if (file_exists(“testfile.txt”)) echo “File exists”; 2. Reading from Files: Method 1: Using fgets() to read one line a time:…
Read More