如图是phpinfo()函数的结果,为什么有一个错误?

//检查年纪是否数字 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




慕森卡
浏览 73回答 2
2回答

绝地无双

(strlen($_POST['year']==4)这句当为空时,里面参数就会是空,从而导致函数失效Warning: Wrong parameter count for strlen() in C:\AppServ\www\wocs.php on line 2

慕田峪4524236

strlen前面的括号是中文的(,应该改为英文(
打开App,查看更多内容
随时随地看视频慕课网APP