Ask a string segmentation question & nbsp; I have a string that may contain "+", & nbsp; "+", & nbsp; "-", & nbsp; "-", & nbsp; "& nbsp;", & nbsp; "", & nbsp ;". ", & nbsp ;". ", & nbsp;": "Ask a question about string segmentation.
I have a string that may contain "+", "+ ","-","-","","",". ",". ",": ",": ", I will replace them.
$ Vowels = array ("+", "+ ","-","-","","",". ",". ",":",":");
$ File_name = str_replace ($ vowels, "+", $ str );
As a result, a character such as "question ++ Xiao Zhao + cartoon talents group + swf" is displayed. However, I need the Chinese character section and ask how to separate it, or is my replacement method not applicable from the very beginning? thank you ~ Php string segmentation
------ Solution --------------------
Isn't that true? If you do not need +, str_replace ($ vowels, "", $ str );
Or even swf?
------ Solution --------------------
$ Arr = preg_split ('/[+] +/', $ file_name );
Print_r ($ arr );