Created
January 10, 2014 13:14
-
-
Save csalgueiro/8351737 to your computer and use it in GitHub Desktop.
Funcion para generar aleatoriamente matriculas europeas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generateMatricula() { | |
| $numbers = '0123456789'; | |
| $characters = 'BCDFGHIJKLMNPQRSTVWXYZ'; | |
| $randomString = ''; | |
| for ($i = 0; $i < 4; $i++) { | |
| $randomString .= $numbers[rand(0, strlen($numbers) - 1)]; | |
| } | |
| for ($i = 0; $i < 3; $i++) { | |
| $randomString .= $characters[rand(0, strlen($characters) - 1)]; | |
| } | |
| return $randomString; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment