Re: [PHP] Newbie: Array of objects iteration

2009-10-11 Thread Tommy Pham
- Original Message > From: MEM > To: Tommy Pham ; 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.refl

Re: [PHP] Newbie: Array of objects iteration

2009-10-10 Thread Torben Wilson
2009/10/10 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 bet

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: http://pt.php.

Re: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread Tommy Pham
- Original Message > From: MEM > To: MEM ; Fernando Castillo Aparicio ; > Lester Caine ; php-general@lists.php.net > Sent: Fri, October 9, 2009 6:22:05 AM > Subject: RE: [PHP] Newbie: Array of objects iteration > > > Right now, I have something like this: >

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...

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 proper

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 t

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 >ob

Re: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread Fernando Castillo Aparicio
De: MEM Para: Lester Caine ; 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, however, please let me share the

RE: [PHP] Newbie: Array of objects iteration

2009-10-09 Thread MEM
o.uk] > Sent: sexta-feira, 9 de Outubro de 2009 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: > > > > forea

Re: [PHP] Newbie: Array of objects iteration

2009-10-08 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 glob

Re: [PHP] Newbie: Array of objects iteration

2009-10-08 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 ;-) _