PHP/Math/Random — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 10:06, 26 мая 2010
mt_rand with no arguments
<source lang="html4strict">
<?
print("Seeding the generator
");
mt_srand((double)microtime() * 1000000);
print("With no arguments: " . mt_rand() . "
");
print("With no arguments: " . mt_rand() . "
");
print("With no arguments: " . mt_rand() . "
");
?>
</source>
mt_rand with two arguments
<source lang="html4strict">
<?
print("Seeding the generator
");
mt_srand((double)microtime() * 1000000);
print("With two arguments: " .mt_rand(27, 31) . "
");
print("With two arguments: " .mt_rand(27, 31) . "
");
print("With two arguments: " .mt_rand(27, 31) . "
");
?>
</source>