Possible Duplicate:
Mixed Array and object
I'm using print_r
to see what the array contains:
Array (
[2] => stdClass Object (
[id] => 2
[category] => 1
[sortorder] => 10001
[shortname] => 2323
[fullname] => asdaSDa
[startdate] => 1343188800
[visible] => 1
[groupmode] => 0
[groupmodeforce] => 0
[numsections] => 10
[role] => student
[rolename] => Student
)
)
I'd like to retrive the value of [id]
. How can achieve this using PHP?
I've tried the following but receive an exception 500 from the server:
echo "<h1>CODIGO: ".$courses[2]["id"]."</h1>";
Any suggestions?