php - Problem converting string into a array -
i have array
$arr1 = array('0' => '674534856|213123213|232313123', [1] => '349578449|782374879|232313123'); loop through arr1 array, for($x=0;$x<$count;$x++){ $check = explode("|", $arr1[$x]); array_pop($check); $count_check = count($check); for($z=0;$z<$count_check;$z++){ array_push($result, $check[$z]); } }
it's not working expected. appreciated. thanks.
edit $result result array
just implode()
in input array same delimiter flatten single string, , explode()
delimiter:
$result = explode('|', implode('|', $arr1));
Comments
Post a Comment