php验证码不辨别大小写
起首我们对存在SESSION内的验证码运用strtolower函数将它转为小写;然后将用户提交的内容一样运用strtolower函数转为小写;末了举行比较即可。
代码:
session_start(); $str_number = trim($_POST['number']); if(strtolower($_SESSION['rand'])==strtolower($str_number )){ echo "验证码准确"; }else{ echo "验证码不准确"; }
更多PHP相干学问,请接见ki4网!
以上就是php验证码不辨别大小写的细致内容,更多请关注ki4网别的相干文章!