Home > Backend Development > PHP Problem > PHP verification code is not case sensitive

PHP verification code is not case sensitive

angryTom
Release: 2023-02-28 07:56:02
Original
4864 people have browsed it

PHP verification code is not case sensitive

php verification code is not case-sensitive

First we use the strtolower function on the verification code stored in SESSION to It is converted to lowercase; then the content submitted by the user is also converted to lowercase using the strtolower function; and finally the comparison is done.

Code:

session_start();
$str_number = trim($_POST['number']);
if(strtolower($_SESSION['rand'])==strtolower($str_number )){
echo "验证码正确";
}else{
echo "验证码不正确";
}
Copy after login

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of PHP verification code is not case sensitive. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template