zohab Posted May 6, 2009 Share Posted May 6, 2009 Hi all, I have an array as follow. Array ( [0] => orange [1] => banana [2] => apple [3] => raspberry ) I want to convert it to key value array. Array ( [orange] => banana [apple] => raspberry ) How can i implement it dynamically(using for loop or any other solution). Any idea? Link to comment https://forums.phpfreaks.com/topic/157042-how-to-create-key-value-array-dynamically/ Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 That makes no sense. What if the array has an odd number of items? Then there will be a mismatch. Link to comment https://forums.phpfreaks.com/topic/157042-how-to-create-key-value-array-dynamically/#findComment-827251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.