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
Post a Comment