Здравствуйте! Не могу вывести преобразованную строку из Json:
$str_data = file_get_contents("yql.json");
$data = json_decode($str_data,true);
foreach($data as $k){
echo $k;
}
{"results":
{"quote":
[
{"Symbol":"TIBX",
"Date":"2013-12-31",
"Open":"22.70",
"High":"22.86",
"Low":"22.46",
"Close":"22.48",
"Volume":"1727900",
"Adj_Close":"22.48"
},
{"Symbol":"TIBX",
"Date":"2013-12-30",
"Open":"22.48",
"High":"22.76",
"Low":"22.32",
"Close":"22.67",
"Volume":"1743300",
"Adj_Close":"22.67"
}
]
}
}
Вывести без print_r($k);
, а через echo
. Формат вывода:
2013-12-31 22.70 22.86 22.46 22.48 1727900 22.48
2013-12-30 22.48 22.76 22.32 22.67 1743300 22.67