I have the following code that should strip all non-alphanumeric characters (excluding hyphens) from some text. It somehow misses square brackets somehow, however.
ereg_replace('[^A-z0-9-]', '', strtolower(str_replace(' ','-',$title)))
Can anyone advise?