function date2_in_the_past($day, $month, $year)
{
$datestring = $year . "-" . $month . "-" . $day;
if (date ('Y-m-d', strtotime($datestring)) < date('Y-m-d', strtotime("now",time()))) {
$b = 1; **// I want $b = true**;
}
else { $b = 0; **// I want $b = false;** }
return $b;
}
//echo date2_in_the_past(24, 10, 2013); // returns 0
但它不会用$b = true
or返回任何东西$b = false;
。知道如何使函数工作分配$b
给布尔值而不是写'==1'
或'==0'
吗?