Skip to content

Instantly share code, notes, and snippets.

@stefanocudini
Created March 24, 2012 23:49
Show Gist options
  • Save stefanocudini/2189259 to your computer and use it in GitHub Desktop.
Save stefanocudini/2189259 to your computer and use it in GitHub Desktop.
generate random phrase
<?
//generate random phrase
function randDesc($maxDescLen = 100)
{
$desc ='';
while(true)
{
$lwr = rand(2,8);//lunghezza parola
$W='';
for($lw=0;$lw<$lwr;$lw++)
$W .= chr(rand(97,122));
$desc .= $W.' ';
if(strlen($desc)>$maxDescLen)
break;
}
return $desc;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment