XH1Q8335军绿

WBOY
WBOYOriginal
2016-06-23 14:02:46845browse

怎么用正则将XH1Q8335军绿 分开  XH1Q8335    军绿  两部分


回复讨论(解决方案)

不需要用正则吧,用str_replace('军绿','    军绿','XH1Q8335军绿');

或者:str_replace('XH1Q8335军绿','XH1Q8335    军绿',$str);

或者:str_replace('XH1Q8335军绿','XH1Q8335    军绿',$str);
 
我要是把汉字和其他字符分开.  你这是死方法

$s = 'XH1Q8335军绿';preg_match('/(\w+)(\W+)/', $s, $r);print_r($r);
Array ( [0] => XH1Q8335军绿 [1] => XH1Q8335 [2] => 军绿 ) 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn