Just a quick question. I'm wondering if this code:
$slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $string);
will replace all instances of any character that is a letter or number with the dash. It's supposed to create user friendly post slugs from title string to use within URLs.