I looked for this script forever and I thought I’d share it with you. This script matches all the letters and numbers in a string an returns them back to you.
$string = “The quick brown fox jumped over the lazy dog!”;
$new_string = ereg_replace(“[^A-Za-z0-9]“, “-”, $string);
echo $new_string
Will return this :
The-quick-brown-fox-jumped-over-the-lazy-dog-