I am trying to resolve how to clean up my array and my output should be:
1) all numerical indexed and
2) no duplicate values.
This is a sampling of my current array output:
NOTE: index [3]. I am parsing those values into a new array and do not need either of them. They are merged onto the array below as you can see.
Ultimately I am preparing this for .csv format, but I need my array in some type of sequence in order to keep the data in proper presentation form.
Array // print_r();
(
[0] => 3350
[id] => 3350
[1] => Williamson New England Electric
[company] => Williamson New England Electric
[2] => bob@jojozzz.go
[email] => bob@jojozzz.go
[3] => Pumps & Motors,Electronic Systems,Electrical Supply,Electrical
[industry] => Pumps & Motors,Electronic Systems,Electrical Supply,Electrical
[4] => Pumps & Motors
[5] => Electronic Systems
[6] => Electrical Supply
[7] => Electrical
)
This is what I am trying to achieve:
Array
(
[0] => 3350
[1] => Williamson New England Electric
[2] => bob@jojozzz.go
[4] => Pumps & Motors
[5] => Electronic Systems
[6] => Electrical Supply
[7] => Electrical
)
As I said in my comment, it’s probably easier to get the array as numerical array from the beginning, if you get it from a MySQL database:
Then you can do the following to split the value of the last column:
DEMO