[Array] Excuse me, where's the wrong place?
This post was last edited by Burner on 2015-04-01 13:51:31
$RC = Array ("07-12" = "Classmate Party", "07-21" = "Credit Repayment", "07-23" and "buy goods");
$date = "07-23";
foreach ($rc as $key = = $value) {
if ($key = = $date) {
echo "";
Break
}else{
echo "";
Break
}
}
?>
The third line if it is: $date = "07-12", pop-up prompt box: 07-12 Day Memo: Classmate Party
The third line if it is: $date = "07-21", or: $date = "07-23", should be similar to the same, but pop-up prompt box: no memo
Excuse me, where is the wrong?
------to solve the idea----------------------
$RC = Array ("07-12" = "Classmate Party", "07-21" = "Credit Repayment", "07-23" and "buy goods");
$date = "07-23";
$msg = ";
foreach ($rc as $key = = $value) {
if ($key = = $date) {
$msg = "";
Break
}
}
if (! $msg) $msg = "";
Echo $msg;
Think about why