I want to export an array of objects in CSV :
array(10) {
[0]=>
object(Produit)#228 (36) {
["id_produit":protected]=> string(4) "9999"
["reference":protected]=> string(9) "reference1"
}
[1]=>
object(Produit)#228 (36) {
["id_produit":protected]=> string(4) "8888"
["reference":protected]=> string(9) "reference2"
}
}
IN something like :
id_produit | reference | ...
9999 | reference1 | ...
8888 | reference2 | ...
The first row : list of attribut / column
The other row : value of the attribut of the Object
True Example of array with object : http://pastebin.com/8Eyf46pb
I tried this : Convert array into csv but it doesn't work for me.
Is it possible to do this (and how ?) or I have to write each attribute in a loop ?