Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 18, 2019 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a87e80fccfc37ade82c1dbc8c7f64da3 to your computer and use it in GitHub Desktop.
Save parzibyte/a87e80fccfc37ade82c1dbc8c7f64da3 to your computer and use it in GitHub Desktop.
<?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