php - Parsing StdClass Object from file -


i'm using superfeedr php client, , when gets ping, json_encodes , writes ping file. result saved stdclass object. tried load result via file_get_content can not access of data.

$obj = file_get_contents('result.txt'); echo $obj->title; 

the object long looks like:

stdclass object ( [status] => stdclass object ( [title] => blah ) [title] => blah )

i haven't used php in long time i'm rusty... seems i'm loading object string can't treat object. right? if so, how approach this?

this not appear "save" object file (which not possible anyway), dumps results of print_r($obj) file. useful debugging purposes, it's not possible reconstruct actual object this.

you save result of json_encode file, along lines of this:

{"status":{"title":"blah"},"title":"blah",...} 

this can json_decode'd object or array.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -