I'm trying to decode a selenium server's response. The server returns:
{"sessionId":null,"status":0,"value":{"os":{"arch":"amd64","name":
"Windows Server 2008 R2","version":"6.1"},"java":{"version":"1.7.0_02"},
"build":{"revision":"15105","time":"2011-12-08 09:56:25","version":"2.15.0"}},
"class":"org.openqa.selenium.remote.Response","hCode":1813953336}
and i'm trying to decode it with the following:
$json = json_decode($s->result);
echo '<pre>'.print_r($json, 1).'</pre>';
At this stage the $s object is:
Scrape Object
(
[headers] => Array
(
)
[result] => {"sessionId":null,"status":0,"value":{"os":{"arch":"amd64","name":"Windows Server 2008 R2","version":"6.1"},"java":{"version":"1.7.0_02"},"build":{"revision":"15105","time":"2011-12-08 09:56:25","version":"2.15.0"}},"class":"org.openqa.selenium.remote.Response","hCode":287101789}
[http_code] => 200
[error] =>
)
However when I actually paste the results into json_decode() it does it just fine? Where am I going wrong?