Handy Functions Archive
-
Convert Database Date to Something More ‘User Friendly’
Posted on 12th Nov 2011 | No Comments// // Convert database date to something more user friendly // function userFriendlyDbDate($date){ $time = strtotime($date); return date('d/m/Y H:i', $time); } -
PHP Email Validation
Posted on 11th Nov 2011 | No CommentsEmail validation is something that is needed in a variety of situations, but I’ve always struggled to find a good one…. Well, here are 2! The first is something I... -
jQuery Date Picker to MySQL Database Format
Posted on 15th Apr 2011 | No Comments// // Convert a date from jQuery 'Date picker' date to the database date format // function dpDateToDbDate($date){ $time = strtotime($date); return date('Y-m-d', $time); } -
Convert a ‘safe’ url into words, for display on the page or inserting into a database
Posted on 15th Apr 2011 | No Comments// // Convert a 'safe' url into words, for display on the page or inserting into a database // function purifyURL($url){ $url = trim($url); $bannedChars = array("'",':','@'); $url = str_replace($bannedChars,... -
Convert Text to ‘Safe Url’
Posted on 15th Apr 2011 | No Comments// // Convert Text to 'Safe Url' // // Mark Jacksons Function function safeURL($txt,$allowSpace=false,$allowCaps=false) { $find = array('/à|á|â|ã|ä|å/', '/ç/', '/è|é|ê|ë/', '/ì|í|î|ï/', '/ñ/', '/ð|ó|ò|ô|õ|ö|ø/', '/ù|ú|û|ü/', '/ý|ÿ/'); $replace = array('a', 'c', 'e',...

