Nodral Posted September 29, 2011 Share Posted September 29, 2011 Hi All I have a script which imports values from a csv file created using excel. However there are several blank values within the file where the person creating it has used blank columns to create whitespace in the file. I have used array_filter to remove these from the array, however how do I remove the redundant keys and 'squash' everything together so it is nice and neat? eg import would be , ,id, , surname, ,firstname, ,DOB, , address, , which returns array after array_filter [1]-> id [3]->surname [5]->firstname [7]->DOB [9]->address I want to return as an array which would be [0]-> id [1]->surname [2]->firstname [3]->DOB [4]->address Is there a function to do this or would I need to create a custom one? Quote Link to comment https://forums.phpfreaks.com/topic/248095-array-filter/ Share on other sites More sharing options...
Muddy_Funster Posted September 29, 2011 Share Posted September 29, 2011 have a go with this: $array_name = array_values($array_name); Quote Link to comment https://forums.phpfreaks.com/topic/248095-array-filter/#findComment-1273958 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.