php - How can I get array like this -
//i have array below: $a =array('1,2,6'); $b =array('2,3,1'); //then using arraycombine : $arr_combine = array_combine( $a, $b ); //output: //array( [1,2,6] => 2,3,1 ) ;
how can array below?
//output: array( 1=>2, 2=>3, 6=>1 );
if have array that, have explode element.
$result = array_combine(explode(',', $a[0]), explode(',', $b[0]));
Comments
Post a Comment