//檢查年紀是否數字 if(is_numeric($_POST['year']) AND (strlen($_POST['year']==4)){ if ($_POST['year'] < 2011) { $age=2014-$_POST['year'];} else { print '<p class="error">Either you entered your birth year wrong or you come from the future!</p>'; $okay=FAlSE;} } else { // 不滿足條件1,則: print '<p class="error">Please enter the year you were born as four digits.</p>'; $okay = FALSE; }以上是代碼,以下是出現的問題:PHP Fatal error: Call to undefined function (strlen() in ***, 其中extension=php_mbstring.dll 關面的分號我已經去掉。PHP 5.3版本 加IIS7.5
2 回答

絕地無雙
TA貢獻1946條經驗 獲得超4個贊
(strlen($_POST['year']==4)這句當為空時,里面參數就會是空,從而導致函數失效
Warning: Wrong parameter count for strlen() in C:\AppServ\www\wocs.php on line 2
- 2 回答
- 0 關注
- 114 瀏覽
添加回答
舉報
0/150
提交
取消