我上下搜索,但似乎無法讓這個數組正常工作,我錯過了一些簡單的東西,但無法弄清楚究竟是什麼。PHP多維數組不顯示值
<?php
$dates2 = 'Aug 30, 2013';
$dates3 = 'Sep 13, 2013';
$cards[0] = array(
'card' => 'Discover',
'pay' => '875',
'when' => array('
'Sep 03, 2013',
'Oct 03, 2013',
'Nov 03, 2013',
'Dec 03, 2013'
),
);
$cards[1] = array(
'card' => 'Visa',
'pay' => '375',
'when' => array(
'Sep 23, 2013',
'Oct 23, 2013',
'Nov 23, 2013',
'Dec 23, 2013'
),
);
$cards[2] = array(
'card' => 'Mastercard',
'pay' => '1025',
'when' => array(
'Sep 12, 2013',
'Oct 13, 2013',
'Nov 13, 2013',
'Dec 13, 2013'
),
);
$cards[3] = array(
'card' => 'Amex',
'pay' => '650',
'when' => array(
'Aug 25, 2013',
'Sep 05, 2013',
'Oct 25, 2013',
'Nov 25, 2013'
),
);
for ($i=0; $i<=3; $i++){
if ($cards[$i]['when'][$i] > $dates2 && ($cards[$i]['when'][$i] < $dates3) or ($cards[$i]['when'][$i] == $dates2)) {
print "<tr>
<td>$cards[$i]['card']</td>
<td><input class='amount' size='3' value='$cards[$i]['pay']'></td>
</tr>";
}
}
?>
輸出:數組[ '卡']數組[ '卡']數組[ '卡']數組[ '卡']
好奇,爲什麼它有反對票?如果你想讓某人失望,你應該提供有關爲什麼的反饋。 – Brant