Jump to content
php.lv forumi

vienkāršs skripts


ghx

Recommended Posts

$lenght = rand(1,500);
$source = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPrRsSuUvVzZxXwWqQ1234567890';
$sLenght = strlen($source) - 1;

$out = '';
$wl = 0;
for($i = 0; $i < $lenght; $i++) {
$el = rand(0,$sLenght);
$out .= $source{$el};
$wl ++;
if(rand(1,15) <= $wl) {
	$out .= ' ';
	$wl = 0;
}
}
echo $out;

:)

Edited by john.brown
Link to comment
Share on other sites

×
×
  • Create New...