Re: [PHP] Newbie: Array of objects iteration

2009-10-11 Thread Tommy Pham
- Original Message From: MEM tal...@gmail.com To: Tommy Pham tommy...@yahoo.com; php-general@lists.php.net Sent: Sat, October 10, 2009 2:49:23 AM Subject: RE: [PHP] Newbie: Array of objects iteration MEM, http://www.php.net/language.oop5.reflection Regards, Tommy

RE: [PHP] Newbie: Array of objects iteration

2009-10-10 Thread MEM
MEM, http://www.php.net/language.oop5.reflection Regards, Tommy And brand new world opens in from of my eyes... O.O. I will search more info on this on the net... just for the records, as properties names is concern, I couldn't find any better I suppose:

Re: [PHP] Newbie: Array of objects iteration

2009-10-10 Thread Torben Wilson
2009/10/10 MEM tal...@gmail.com: MEM, http://www.php.net/language.oop5.reflection Regards, Tommy And brand new world opens in from of my eyes... O.O. I will search more info on this on the net... just for the records, as properties names is concern, I couldn't find any better I

Re: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread Fernando Castillo Aparicio
I think you are just looking for the key in the wrong place. Try: foreach ( $records as $record ) { foreach( $record as $column=$value ) { echo $column is $value\n; } } You've got the columns names in each record, not in the global recorset. Good luck ;-)

Re: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread Lester Caine
Fernando Castillo Aparicio wrote: I think you are just looking for the key in the wrong place. Try: foreach ( $records as $record ) { foreach( $record as $column=$value ) { echo $column is $value\n; } } You've got the columns names in each record, not in the global

RE: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread MEM
07:23 To: php-general@lists.php.net Subject: Re: [PHP] Newbie: Array of objects iteration Fernando Castillo Aparicio wrote: I think you are just looking for the key in the wrong place. Try: foreach ( $records as $record ) { foreach( $record as $column=$value ) { echo

Re: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread Fernando Castillo Aparicio
De: MEM tal...@gmail.com Para: Lester Caine les...@lsces.co.uk; php-general@lists.php.net Enviado: vie,9 octubre, 2009 12:40 Asunto: RE: [PHP] Newbie: Array of objects iteration @LinuxManMikeC and all @All Thanks. I was more or less aware of that possibility

RE: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread MEM
Correct about my example, although I'm not sure if you get each record as an array or as an object. Anyway, you can iterate both. And if you want to get the column names, I suppose you could use array_keys() on the first record if you receive an array, or maybe get_object_vars() if it's an

RE: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread MEM
Right now, I have something like this: foreach ($objRecord as $record) { //we will have a new line. $xls_file .=\n; foreach ($record as $column=$value) { $xls_file .= $value.\t; } } The only thing I need now, is to put on top, the

RE: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread MEM
Dear all, it's done. Can I call your help for the remain issues please, I'm sure they are easy to explain, and at some extend, common: http://pastebin.com/m691d3e66 Instead of saving to the database, if I do a print_r or a var_dump, I get the charsets quite ok. However, they do not appear

RE: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread MEM
Done. print utf8_decode($xls_file); Regards, Márcio -Original Message- From: MEM [mailto:tal...@gmail.com] Sent: sexta-feira, 9 de Outubro de 2009 18:19 To: 'MEM'; 'Fernando Castillo Aparicio'; 'Lester Caine'; 'php- gene...@lists.php.net' Subject: RE: [PHP] Newbie: Array

Re: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread Tommy Pham
- Original Message From: MEM tal...@gmail.com To: MEM tal...@gmail.com; Fernando Castillo Aparicio f_c_a_1...@yahoo.es; Lester Caine les...@lsces.co.uk; php-general@lists.php.net Sent: Fri, October 9, 2009 6:22:05 AM Subject: RE: [PHP] Newbie: Array of objects iteration Right