RE: Newbie: Array of objects iteration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 column names, and I
> have myself a xls file. YUpii!!
> 
> I just need the column names... I will take a look on those functions
> you have mentioned.
> 
> Thanks a lot, :)
> Márcio


Update:

"PDO::FETCH_OBJ
Returns an anonymous object with property names that correspond to the
column names returned in your result set."

I will give a shot on array_keys however, is there any method to access the
PROPERTIES NAMES of a given object?


Regards,
M.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux