php json_decode

php代码

<?php
$data='[{"Name":"a1","Number":"123","Contno":"000","QQNo":""},{"Name":"a1","Number":"123","Contno":"000","QQNo":""},{"Name":"a1","Number":"123","Contno":"000","QQNo":""}]';
echo json_decode($data);
?>

输出结果

Array ( [] => stdClass Object ( [Name] => a1 [Number] =>  [Contno] =>  [QQNo] => ) [] => stdClass Object ( [Name] => a1 [Number] =>  [Contno] =>  [QQNo] => ) [] => stdClass Object ( [Name] => a1 [Number] =>  [Contno] =>  [QQNo] => ) ) 

php代码

<?php
$data='[{"Name":"a1","Number":"123","Contno":"000","QQNo":""},{"Name":"a1","Number":"123","Contno":"000","QQNo":""},{"Name":"a1","Number":"123","Contno":"000","QQNo":""}]';
echo json_decode($data,true); // 区别在这里
?>

输出结果

Array ( [] => Array ( [Name] => a1 [Number] =>  [Contno] =>  [QQNo] => ) [] => Array ( [Name] => a1 [Number] =>  [Contno] =>  [QQNo] => ) [] => Array ( [Name] => a1 [Number] =>  [Contno] =>  [QQNo] => ) ) 
上一篇:微软BI 之SSIS 系列 - 通过 ROW_NUMBER 或 Script Component 为数据流输出添加行号的方法


下一篇:IntegerCache类