/**
* generate_rand
*
* chaine de caractère aléatoire.
*
* @param length nombre de caractères
*/
function generate_rand($length=4) {
$chn = '';
for ($i = 1; $i <= $length; $i++)
$chn .=chr(floor(rand(0, 25) + 97));
return $chn;
}
aleatoire fonctions php
<iframe width="100%" height="434" src="http://snipet.teknotit.com/index.php?embed=5440918b74687" type="text/html"></iframe>
Texte seul - Permalink - Snippet public posté le 17/10/2014
/**************
* Générer une chaîne de caractère aléatoire
*@length - longueur de chaîne aléatoire (doit être divisible par 2)
**************/
function readable_random_string($length = 6){
$conso=array("b","c","d","f","g","h","j","k","l",
"m","n","p","r","s","t","v","w","x","y","z");
$vocal=array("a","e","i","o","u");
$password="";
srand ((double)microtime()*1000000);
$max = $length/2;
for($i=1; $i<=$max; $i++)
{
$password.=$conso[rand(0,19)];
$password.=$vocal[rand(0,4)];
}
return $password;
}
aleatoire fonctions php
<iframe width="100%" height="524" src="http://snipet.teknotit.com/index.php?embed=54408b8d1dbdb" type="text/html"></iframe>
Texte seul - Permalink - Snippet public posté le 17/10/2014