phpretard Posted November 11, 2010 Share Posted November 11, 2010 I am using pieces of an array like this: $data['0']; $data['2']; $data['3']; and so on...I think up to around $data['70']; I need to take the values of $data['29'] through $data['64'] and combine them. (stumped) On top of that I have to comma separate those now combined values (stumped). Actuall Code: $handle = fopen("test.csv", "r"); while (($data = fgetcsv($handle, 5000, ",")) !== FALSE){ $needed = $data['29'] .", ". $data['30'] .", ".$data['31']; // ALL THE WAY TO $data['65'] } I know how to do it the long way, could someone help me shorten my work? Thank you for your help. Quote Link to comment https://forums.phpfreaks.com/topic/218410-merge-array-values/ Share on other sites More sharing options...
ManiacDan Posted November 11, 2010 Share Posted November 11, 2010 One part array_slice and one part implode. Bake at 350 for 10 minutes. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/218410-merge-array-values/#findComment-1133112 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.