How to remove the parent numeric keys of php array -


i've array in php below

array (     [0] => array         (             [0] => 40173             [1] => 514081             [2] => 363885             [3] => 891382         ),     [1] => array         (             [0] => 40173             [1] => 5181             [2] => 385             [3] => 891382         )  ) 

now want remove parents indexes 0,1... , want values (only unique values).

thanks.

one possible approach using call_user_func_array('array_merge', $arr) idiom flatten array, extracting unique values array_unique():

$new_arr = array_unique(   call_user_func_array('array_merge', $old_arr)); 

demo. obviously, it'll work array of length.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -