Accesing specific array in php -


this question has answer here:

i have following array printed out var_dump($myarray):

array(2) {      [0]=> object(stdclass)#2 (4) {          ["date"]=> string(25) "2015-07-17t05:31:49+02:00"          ["author"]=> string(2) "me"          ["subject"]=> string(9) "mysubject"          ["message"]=> string(19) "this message."      }       ["message"]=> string(4) "test"   } 

i want print out subject. tried

echo $myarray[0]["subject"]; 

but empty site. help.

as dump explained ... object

so can access via echo $myarray[0]->subject;


Comments