How can I parse this array? Thank you. Array (& nbsp; [doctorDate] & nbsp ;=& gt; & nbsp; Array & nbsp; & nbsp; (& nbsp; & nb: how can I parse this array? Thank you.
Array
(
[doctorDate] => Array
(
[0] => Array
(
[doctorOfDate] => 2013-10-02
[orderingCount] => 12
)
[1] => Array
(
[doctorOfDate] => 2013-10-03
[orderingCount] => 8
)
)
)
Share :? Array ???????? (???????????? [0]? =>? Array ???????????????? (??????... 'Data-pics = ''>
------ Solution --------------------
Assume that the array name is test.
Test ['doctordate'] [0] ['doctorofdate'] = 2013-10-02
Test ['doctordate'] [0] ['orderingcount'] = 12
Test ['doctordate'] [1] ['doctorofdate'] = 2013-10-03
Test ['doctordate'] [1] ['orderingcount'] = 8
The array is defined:
test=array('doctorDate'=>
array(0=>array('doctorDate'=>'2013-10-02',
'orderingCount'=>12),
1=>array('doctorDate'=>'2013-10-03',
'orderingCount'=>8)
)
)
------ Solution --------------------
$test=array('doctorDate'=>
array(0=>array('doctorDate'=>'2013-10-02',
'orderingCount'=>12),
1=>array('doctorDate'=>'2013-10-03',
'orderingCount'=>8)
)
);
foreach ($test as $arr)
{
foreach ($arr as $value)
{
echo $value['doctorDate'].' '.$value['orderingCount'].'
';
}
}
?>