【发布时间】:2023-03-28 07:11:01
【问题描述】:
我在下面的用户函数中看到了一个名为 isdate 的内置函数,当我检查 PHP 文档时,我没有找到它。它是否存在,它有什么作用;或者这只是一个错字?
function mystery($a, $b, $c) {
$result = null;
if (strlen(trim($a)) == 0) {
$result = $c;
}
else {
if (strtolower(trim($b)) == "n") {
if (!is_numeric($a)) {
$result = $c;
}
else {
$result = trim($a);
}
}
else {
if (strtolower(trim($b)) == "d") {
if (!isdate($a)) {
$result = $c;
}
else {
$result = trim($a);
}
}
else {
$result = $a;
}
}
}
return($result);
}
【问题讨论】:
-
你的标题错了——根本没有循环......
-
True John31316,这里没有循环。已编辑。
标签: php date if-statement