This question already has an answer here:
i have tried many ways to split the string though am not that good in this programing language my string looks like this
{"success":true," URL ":"WWW.face-book.com", "rank":9, "details":null}
how do i separate my strings in such a way that the output looks like-
URL: WWW.face-book.com
rank: 9
</div>
You use json_decode($yourJsonStringHere);
and youll get an Object from the class "stdClass" with public properties for all your keys.
So you can basically to the following:
$jsonObj=json_decode($jsonString);
echo $jsonObj->URL;
echo $jsonObj->rank;
echo $jsonObj->success;
echo $jsonObj->details;
See http://php.net/manual/en/function.json-decode.php for more info on the function itself.