mercredi 15 janvier 2020

How to Valid a Number before entering the database using the check digit PHP

i am trying to run a check digit on a group of numbers for my PHP application. Lets say we have a number like 2040240001965-1. The last digit after the hyphen is the check digit. It is calculated by adding the last 5 digits of the number which is 0 + 1 + 9 + 6 + 5 = 21. Then picking the last digit which is one. if the number for instance is 2040240001001-2 then the check digit is 2. I want the last digit to be validated if it is correct before it it entered in the database.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30uranG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire