Created
July 18, 2019 15:55
-
-
Save parzibyte/a87e80fccfc37ade82c1dbc8c7f64da3 to your computer and use it in GitHub Desktop.
Cadena aleatoria con str_shuffle php https://parzibyte.me/blog/2018/12/06/generar-cadena-aleatoria-en-php/
This file contains 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
<?php | |
/* | |
Generar cadena aleatoria en PHP con str_shuffle | |
@author parzibyte | |
*/ | |
$caracteres = '123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-.#!'; | |
for($x = 0; $x < 10; $x++){ | |
$aleatoria = substr(str_shuffle($caracteres), 0, 10); | |
echo $aleatoria . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment