php - regex match some special chars -


this question has answer here:

i have strings this:

  hello my_string is-very-cool & stuff 

how can explode(?) string special chars allowing spaces, - , _ ?

any ideas?

preg_split('/[^\w -]/', $string) 

this split on isn't a-z, 0-9, _, - or space.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -