4,250
社区成员
发帖
与我相关
我的任务
分享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>显示$s =<<< JSON
{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"}
JSON;
$s = iconv('gbk', 'utf-8', $s);
$s = preg_replace('/(\w+[a-z]):/i', '"$1":', $s);
print_r(json_decode($s));显示stdClass Object
(
[data] => Array
(
[0] => stdClass Object
(
[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
)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"}))