How to parse url response? How to parse url response? curl curl

How to parse url response?


It JSON format so use json_decode() function.

$response = json_decode($response);echo $response->body->sid;

or

$response = json_decode($response, true);echo $response['body']['sid'];

If you pass second argument as true then it will return associative array.


The above response looks to b JSON so you can use json_decode()function.

Try

$response = file_get_contents($url);$json = json_decode($response);echo $json->body->sid;

Note You need to replace $url with URL of response page.