你好,我有这个字符串,它是一系列代码/参考资料:
<?PHP
$list="1010<1>;1020<?>;3010<?>"; the list of items code
$id="5060<?>"; //will add this
$list_unique=explode(";", $list);
print_r($list_unique);
?>
Run Code Online (Sandbox Code Playgroud)
现在输出为:Array([0] => 1010 <1> [1] => 1020 [2] => 3010)为什么?它原因为什么?它应该是
数组([0] => 1010 <1> [1] => 1020 < ?> [2] => 3010 <?>)