这一个数据怎样解析
我用了json
但是输不出来动西,
当然也无法操作了。
我主要是想得到data[]里面每一个数据。比如
我想得到。og_id 我应该怎么操作呢????
public function getJson($url){
$str=file_get_contents($url);
$data=json_decode($str,true);
echo "<pre>";print_r($data);exit();
return $data;
}
在浏览器里找打开连接是这样的。
SINAFINANCE132436359014192800(({data:[{og_id:"1061971",contest_id:"8",sid:"2096647540",StockCode:"sz002230",StockName:"科大讯飞",SellBuy:"0",OrderPrice:"34.700",DealAmount:"4200",OrderAmount:"4200",IfDealt:"1",OrderTime:"2011-10-25 09:58:44",mtime:"2011-10-25 09:58:44",remark:""}],count:"100"}))
<script>function SINAFINANCE132436359014192800(v) { for(t in v) { if(typeof(v[t]) == 'object') SINAFINANCE132436359014192800(v[t]) document.write(t + ':'+v[t]+'<br>'); }}SINAFINANCE132436359014192800(({data:[{og_id:"1061971",contest_id:"8",sid:"2096647540",StockCode:"sz002230",StockName:"科大讯飞",SellBuy:"0",OrderPrice:"34.700",DealAmount:"4200",OrderAmount:"4200",IfDealt:"1",OrderTime:"2011-10-25 09:58:44",mtime:"2011-10-25 09:58:44",remark:""}],count:"100"}))</script>
[解决办法]