Possible Duplicate:
How can I split a list with multiple delimiters?
I am a newbie in php and My client want me to search utility in php webapplication using which user can enter words having spaces or commas. I am not sure is this possible in php to seaparate a string based on commas and spaces as well. As explode converts the string in array which can not be again used with explode..
For more complex string splitting, use
preg_split()ormb_split()and supply a regular expression.Use
mb_split()if your input string is in a multibyte encoding and you need to match against those characters for your split expression.Example: