how to convert array in php -
this question has answer here:
- convert multidimensional array single array 10 answers
hi got array database.
array (size=4) 0 => array (size=1) 0 => array (size=1) 'email_1' => string 'denise@aaa.com' (length=18) 1 => array (size=1) 0 => array (size=1) 'email_1' => string 'denise@aaa.com' (length=18)
and need this
array (size=4) 0 => array (size=1) email_1' => string 'denise@aaa.com' (length=18) 1 => array (size=1) 'email_1' => string 'denise@aaa.com' (length=18)
i tried array_merge , all. no idea how archive this?
do below:-
$final_array = array(); foreach($original_array $key=>$val){ $final_array[$key][] = $val[0]['email_1']; } print_r($final_array);
output:-https://eval.in/848213
wiki
Comments
Post a Comment