Skip to content

Instantly share code, notes, and snippets.

View davewoodhall's full-sized avatar

Dave Woodhall davewoodhall

View GitHub Profile
<?php
// I like to verify if a function exists just because anyone (including yourself)
// could screw up the file accidently so always verify, so my functions are wrapped
// inside a if(function_exists('function_name')) condition
// Replace wierd non-URL-safe characters
if(!function_exists('dw_replaceChars')) {
function dw_replaceChars($str) {
// List all wierd characters and match with what we want