j'ai trouvé ce bout de code :
<?php
// Andy Shellam, andy [at] andycc [dot] net
// generate a random string of numbers/letters
settype($template, "string" );
// you could repeat the alphabet to get more randomness
$template = "1234567890abcdefghijklmnopqrstuvwxyz";
function GetRandomString($length) {
global $template;
settype($length, "integer" );
settype($rndstring, "string" );
settype($a, "integer" );
settype($b, "integer" );
for ($a = 0; $a <= $length; $a++) {
$b = rand(0, strlen($template) - 1);
$rndstring .= $template[$b];
}
return $rndstring;
}
echo GetRandomString(30);
?>
comprends pas grand chose mais fonctionne