时时商务社区
标题:
php校验表单检测字段是否为空的方法
[打印本页]
作者:
bewin83
时间:
2018-2-14 05:47
本文实例讲述了php校验表单检测字段是否为空的方法。分享给大家供大家参考。具体如下:
php校验表单,检测字段是否为空,当表单中有未填写的字段,则会显示错误信息。
Contact Information
Nickname:
Title:
php后端代码,保存为: ErrorCheck.php
0)
echo "
Please use your browser's back button " .
"to return to the form, and correct error(s)";
?>
trim()函数可以去除字符串中的前后空字符
" " (ASCII 32 (0×20)), an ordinary space.
"\t" (ASCII 9 (0×09)), a tab.
"\n" (ASCII 10 (0x0A)), a new line (line feed).
"\r" (ASCII 13 (0x0D)), a carriage return.
"\0″ (ASCII 0 (0×00)), the NUL-byte.
"\x0B" (ASCII 11 (0x0B)), a vertical tab.
希望本文所述对大家的php程序设计有所帮助。
您可能感兴趣的文章:
php不允许用户提交空表单(php空值判断)
PHP表单验证内容是否为空的实现代码
欢迎光临 时时商务社区 (http://bbs.4435.cn/)
Powered by Discuz! X3.2