时间:2021-07-01 10:21:17 帮助过:13人阅读
$str='123456的78';$arr1=preg_split('/<.*>/U',$str);array_pop($arr1);preg_match_all('/<.*>/U',$str,$arr2);$arr3=array_merge($arr1,$arr2);print_r($arr3);
Array( [0] => 1234 [1] => 56的78 [2] => Array ( [0] => [1] => ))
$str='123456的78';$arr1=preg_split('/<.*>/U',$str);array_pop($arr1);preg_match_all('/<.*>/U',$str,$arr2);$arr3=array_merge($arr1,$arr2);print_r($arr3);
Array( [0] => 1234 [1] => 56的78 [2] => Array ( [0] => [1] => ))
$s='123456的78';preg_match_all('/([^<>]+|<[^>]+>)/', $s, $m);print_r($m[0]);