取得数组格式数据并显示数组内容:
$arr = C::t('bianjie')->fetch_bianjie($id);
//显示数组内容
print_r($bianjie_arr);
exit;
显示结果:
Array( [0] => Array ( [ID] => 1 [REPORTPERIOD] => [UUID] => 587d4678adbcd [DZM] => 110101 [BJMC] => 中山公园 [IFSHOW] => [PJ] => [CZWT] => [UID] => 2 [UNAME] => cbq [BORDER_DOTS] => (116.398483,39.919086);(116.402471,39.919224);(116.40301,39.915018);(116.398878,39.914769); [SM] => [DATELINE] => 1484605047 [FROMIP] => ))
——————————————————————————————————————————————————
取得二维数组特定值:
$border = $bianjie_arr[0]['BORDER_DOTS'];
————————————————————————————
遍历二维数组
<?php
$arr = array('one'=>array('name'=>'张三','age'=>'23','sex'=>'男'),
'two'=>array('name'=>'李四','age'=>'43','sex'=>'女'),
'three'=>array('name'=>'王五','age'=>'32','sex'=>'男'),
'four'=>array('name'=>'赵六','age'=>'12','sex'=>'女'));
foreach($arr as $k=>$val){
echo $val['name'].$val['age'].$val['sex']."<br>";
}
echo "<p>";
?>