从PHP中的Json String返回一个结果[重复]

This question already has an answer here:

hi im trying to return 1 set of array from a json string in my code from searching nas i would like to show the data associated with that name. Any suggestions would be great .. thanks

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

//echo $_GET['urlname'];

$json_string =    file_get_contents("http://192.168.1.104/testing_JSON/newjson.json");
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['contacts'];

for(var i = 0; i < $parsed_json.length; i++)
{
if($parsed_json[i].$parsed_json.name == 'nas')
{
 return $parsed_json[i].$parsed_json.name;
}
}
?

im getting a white screen with the above code.

thanks

</div>

Use echo instead of return. Return doesn't print anything.