PHP変数の次のJSON配列から値を取得しようとしています。
これは配列のvar_dumpです:
array(1) { [0]=> object(stdClass)#1 (1) { ["row"]=> object(stdClass)#2 (1) { ["u_fname"]=> string(6) "Ashish" } } }
これは私のページのコードです。$
文字はのショートカットですwindow.jQuery
。
$contents = file_get_contents('http://localhost/skillbook/json.php');
$contents = utf8_encode($contents);
$results =var_dump(json_decode($contents));
?>
$contents = file_get_contents('http://localhost/skillbook/json.php');
$contents = utf8_encode($contents);
$contents_array = json_decode($contents,1);
$foundvalue= $contents_array[0]["row"]["u_fname"];
echo $foundvalue;
OutPut:Ashish
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加