views:

21

answers:

1

Hey

I have the following code that should strip all non alphanumerics (excluding hyphens) from some text. It does however miss square brackets somehow?

ereg_replace('[^A-z0-9-]', '', strtolower(str_replace(' ','-',$title)))

Can anyone advise?

+1  A: 

I made a typo and wrote A-z instead of a-z... A-z encompasses [ and ] characters

Chris