I asked a little while back how to replace everything but numbers and letters in a string? Well, I ended up with this code:
Code: Select all
$string = preg_replace('/ї^\wa-z0-9]/i', '', $string);I would much prefer it to not remove hyphens (-)
Is there anyway I can make the above code not remove hyphens from a string of text?
Ben