Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PHP字符串与正则表达式爆炸示例数据:
"A" 100000 "M" "C" "J" "JOHNSON TRENCHING" 238910
array ( 0 => 'A', 1 => '100000', 2 => 'M', 3 => 'C', 4 => '', 5 => '', 6 => 'JOHNSON TRENCHING', 7 => '238910' );
尝试这个
$string = '"A" 100000 "M" "C" "J" "JOHNSON TRENCHING" 238910'; $string = preg_match_all('/(\"[a-zA-Z0-9\s]+\")|[0-9]+/', $string, $matches); print_r($matches);