warlord
03-13-2007, 06:51 AM
Hello,
I have two different arrays such as:
[name] => John
[city] => New York
[zipcode] => unknown
[region] => East
[year] => 2007
[gender] => Male
[experience] => unknown
(and)
[name] => Lisa
[city] => Seattle
[zipcode] => unknown
[region] => West
[year] => 2007
[gender] => Female
[job] => Sales
[salary] => unknown
[experience] => unknown
Notice the two extra keys on the last one (job and salary). My question is when I write the arrays to a .csv file how to I keep the columns from getting fouled up when one array is different than another? Sometimes the array might have 5 keys and the next might have 10, etc ...
Thanks ~
I have two different arrays such as:
[name] => John
[city] => New York
[zipcode] => unknown
[region] => East
[year] => 2007
[gender] => Male
[experience] => unknown
(and)
[name] => Lisa
[city] => Seattle
[zipcode] => unknown
[region] => West
[year] => 2007
[gender] => Female
[job] => Sales
[salary] => unknown
[experience] => unknown
Notice the two extra keys on the last one (job and salary). My question is when I write the arrays to a .csv file how to I keep the columns from getting fouled up when one array is different than another? Sometimes the array might have 5 keys and the next might have 10, etc ...
Thanks ~