uid generator - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of uid generator.php
- <?php
- $user = "user".uniqid();
- function generarCodigo($longitud) {
- $key = '';
- $pattern = '1234567890abcdefghijklmnopqrstuvwxyz';
- $max = strlen($pattern)-1;
- for($i=0;$i < $longitud;$i++) $key .= $pattern{mt_rand(0,$max)};
- return $key;
- }
- //Ejemplo de uso
- echo $user.generarCodigo(6); // genera un código de 6 caracteres de longitud.
- ?>
File Description
- uid generator
- PHP Code
- 14 Jan-2020
- 358 Bytes
You can Share it:
Latest PHP Pastes