我目前在普通字符串上使用 preg_match_all
,这些字符串不包含空格,但现在我需要让它能够处理每个空格之间的任何内容。
我需要 abc, hh, hey there, 1 2 3, hey_there_
返回
abc
hh
hey there``1 2 3
hey_there_
但是我的当前脚本只有在遇到空格时才会停止匹配。
preg_match_all("/([a-zA-Z0-9_-]+)+[,]/",$threadpolloptions,$polloptions);
foreach(array_unique($polloptions[1]) as $option) {
$test .= $option.' > ';
}
\s*,\s*
进行分割呢? - anubhava