Created
March 24, 2012 23:49
-
-
Save stefanocudini/2189259 to your computer and use it in GitHub Desktop.
generate random phrase
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
<? | |
//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