Tools & Tips
You are here
PHP: Formatting US Phone Numbers (26 views)
Here's a simple function for formatting US phone numbers with 7 to 10 digits with possible extensions. $phone = trim(stripslashes(strip_tags($_POST['phone']))); $phone = preg_replace("/[^0-9...
Drupal 7: How to Clear Statistics (24 views)
Using a database tool like MySQL Workbench or phpMyAdmin UPDATE `node_counter` set `totalcount` = 0; UPDATE `node_counter` set `daycount` = 0;
PHP: Masking Emails from Bots (22 views)
The following function will aloow you to mask your email from spam bots. function hide_email( $email ) { $character_set = '+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; $key...
PHP: Sort FIles by Most Recent First (18 views)
You can try using a usort (uses a function to compare the values). Then, in your function, convert the filename to a timestamp, using preg_match to take the date portion out of your filename, and...