kevinkhan Posted January 9, 2011 Share Posted January 9, 2011 can any body tell me why im not getting the value of the profile id $json = '{\"profile_id\":100000503667042,\"sk\":\"info\"}'; $obj = (json_decode($json)); print $obj->{'profile_id'}; Link to comment https://forums.phpfreaks.com/topic/223893-can-anybody-tell-my-why-this-json-code-is-not-working/ Share on other sites More sharing options...
BlueSkyIS Posted January 9, 2011 Share Posted January 9, 2011 i suspect it's because you single-quote the string, making it literal. the slashes become actual slashes. you don't need to escape anything within single quotes. removing the slashes in $json should fix the problem. Link to comment https://forums.phpfreaks.com/topic/223893-can-anybody-tell-my-why-this-json-code-is-not-working/#findComment-1157161 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.