I'm trying to get the value from this following JSON array in a PHP variable.
This is a var_dump of the array:
array(1) { [0]=> object(stdClass)#1 (1) { ["row"]=> object(stdClass)#2 (1) { ["u_fname"]=> string(6) "Ashish" } } }
This is my code of the page
<?php
$contents = file_get_contents('http://localhost/skillbook/json.php');
$contents = utf8_encode($contents);
$results =var_dump(json_decode($contents));
?>
However when I tried to get a service from online the file_get_contents
function is not working.
file_get_contents(http://...@gmail.com&pass=12345): failed to open stream: HTTP request failed! HTTP/1.1 403 ModSecurity Action in C:\xampp\htdocs\skillbook\json1.php