sandy1028 Posted November 21, 2007 Share Posted November 21, 2007 Hi, Please help me with this problem $city = $cityname[$i]; $centre=split(":",$centrelist); list($count,$centres) = split(":",$centrelist[$city],2); $listCentre = explode(":",$centres); When i give print $listCentre The output is Array Array Array Array Array $listCentre[0] contains 5 values and $listcentre[1] contains 3 values I want all the values in a single array. I have to merge $listCentre[1] and $listCentre[2] and $listCentre[3] in a single array called $list How can I do it Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 21, 2007 Share Posted November 21, 2007 You can merge arrays using array_merge e.g. <?php $result = array_merge($array1, $array2); print_r($result); ?> Quote Link to comment Share on other sites More sharing options...
sandy1028 Posted November 21, 2007 Author Share Posted November 21, 2007 Hi, i have tried it. but not able to. I should merge $listCentre[0] and $listCentre[1] How can I merge it Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 21, 2007 Share Posted November 21, 2007 What is in $listCentre[0] and $listCentre[1] ? Can you post more of your codes Quote Link to comment Share on other sites More sharing options...
sandy1028 Posted November 21, 2007 Author Share Posted November 21, 2007 hi, Values is present. $listCentre contains 5 Arrays. Each $listCentre[0] contains values in it. I want all the 5 arrays to be merged as a single array Quote Link to comment Share on other sites More sharing options...
snk Posted November 21, 2007 Share Posted November 21, 2007 do you mean to make a new string of those values? 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.