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 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); } 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. Link to comment https://forums.phpfreaks.com/topic/264093-remove-array-keys/#findComment-1353440 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.