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 ( [[email protected]] => John ) [1] => Array ( [[email protected]] => Mary ) ) How can I make it like Array( [[email protected]] => John [[email protected]] => Mary ) ? Thank you Quote Link to comment https://forums.phpfreaks.com/topic/264093-remove-array-keys/ 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 https://forums.phpfreaks.com/topic/264093-remove-array-keys/#findComment-1353436 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 https://forums.phpfreaks.com/topic/264093-remove-array-keys/#findComment-1353440 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.