Published 1st July 2012
Find myself using this fairly often:
$string = preg_replace("/[^a-z0-9]+/i", "", $string);
Gilbert Pellegrom is a Software Engineer living and working in the North of Scotland. You should follow me on Twitter or pop your email in the form below to get updates in your inbox.