Verify the last six digits of ID card php
In the submission form, I have an item that requires me to submit the last six digits of my ID card. How should I write this? That is, the last six digits of the ID card are already in the file. Only if they are entered correctly can the next step be performed!
Thank you everyone, urgent! ! ! ! !
Let me answer
D8888D reply content------------------------------------------------- ----------
Just match the six digits after intercepting
For details, please refer to the string function in the manual
if(substr(fgets(fopen('idcard.txt', 'r')), -6) == $_POST['id_suffix']) {
echo 'match';
} else {
echo 'Does not match';
}
Copy code [ ]
D8888D reply content------------------------------------------------- ----------
It won’t be long before the two are the same
D8888D reply content------------------------------------------------- ----------
Actually, I didn’t explain it clearly. Haha, it’s been solved. Thank you everyone