craygo Posted September 21, 2006 Share Posted September 21, 2006 I am helping a friend and I need to combine 2 arrays. I know there is a simple function in php5 called array_combine. But he has php 4.x.x. Any one know a work around without having to install php5.ThanksRay Link to comment https://forums.phpfreaks.com/topic/21535-array_combine/ Share on other sites More sharing options...
eric1235711 Posted September 21, 2006 Share Posted September 21, 2006 Isn´t you talking about merging? (array_merge)you can make a function to combine... That´s not hard. Link to comment https://forums.phpfreaks.com/topic/21535-array_combine/#findComment-96103 Share on other sites More sharing options...
eric1235711 Posted September 21, 2006 Share Posted September 21, 2006 a very simple function to combine:[code]<?phpfunction ericsCombine($a1, $a2){ $output = array(); foreach($a1 as $key => $value){ $output[$value] = $a2[$key]; } return $output;}?>[/code]or something like that...You can work a little more on this function, it can get better... Link to comment https://forums.phpfreaks.com/topic/21535-array_combine/#findComment-96110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.