我有一个示例代码:
$id = '1,2,3,4,5';
$name = 'Iphone 3,Iphone 3S,Iphone 4,Iphone 4S,Iphone 5';
$id_arr = array($id);
$name_arr = array($name);
$arr = array_combine($id_arr, $name_arr);
print_r($arr);
当我print_r($arr)
是结果是([1,2,3,4,5] =>'Iphone 3,Iphone 3S,Iphone 4,Iphone 4S,Iphone 5')
结果如何解决([1]=>'Iphone 3' [2] => 'Iphone 3S' ... [5]=>'Iphone 5')