CodeIgniter Forums
can an object have a 2 word name? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: can an object have a 2 word name? (/showthread.php?tid=46228)



can an object have a 2 word name? - El Forum - 10-23-2011

[eluser]bill19[/eluser]
Hi,

I'm new to CI. I have an array of objects. Here is the first element:

Array ( [0] => stdClass Object ( [WebSite] => yahoo.com [Last Tested] => 14th of July, 2011 @ 3:55 EDT )

hoe can I refer to [Last Tested]. My code is:


Code:
foreach ($records as $row) {
  print($row['Last Tested']);
  }

but when I run it I get:

Fatal error: Cannot use object of type stdClass as array .

Is there a way to fix it?

Thanks,

KC