日期:2014-05-17 浏览次数:20697 次
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
[