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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -