What I want to do is the following:
If you are getting json string from URL using file_get_contents
, then follow the steps:
$url = "http://localhost/rest/users"; //The url from where you are getting the contents
$response = (file_get_contents($url)); //Converting in json string
$n = strpos($response, "[");
$response = substr_replace($response,"",0,$n+1);
$response = substr_replace($response, "" , -1,1);
print_r(json_decode($response,true));