ayok Posted June 13, 2012 Share Posted June 13, 2012 Hi, I have a question about array. For example I have this array: Array( [0] => Array ( [john@myemail.nl] => John ) [1] => Array ( [mary@myemail.nl] => Mary ) ) How can I make it like Array( [john@myemail.nl] => John [mary@myemail.nl] => Mary ) ? Thank you Quote Link to comment Share on other sites More sharing options...
abdfahim Posted June 13, 2012 Share Posted June 13, 2012 $flatarr = array(); foreach($old_array as $key => $val) { $flatarr = array_merge($flatarr,$val); } Quote Link to comment Share on other sites More sharing options...
ayok Posted June 13, 2012 Author Share Posted June 13, 2012 Hi thanks.. it's a good trick. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.