<?php
void srand( int $seed = 0, int $mode = MT_RAND_MT19937 )
where,
$seed = Arbitrary INTEGER value to be used as seed
$mode = The mode to be used
( SEE the below TABLE )
?>
INTERNAL CONSTANTS PHP 8.2.22 80222 | |
CONTANT NAME | VALUE |
MT_RAND_MT19937 | 0 |
MT_RAND_PHP | 1 |
ed48 |
<?php
$srd01 = srand(0, 0);
var_dump($srd01);
?>
<?php
$seed02 = 100;
$mode02 = MT_RAND_PHP;
$srd02 = srand($seed02, $mode02);
var_dump($srd02);
?>
<?php
$seed03 = 120;
$mode03 = 30;
$srd03 = srand($seed03, $mode03);
var_dump($srd03);
?>
<?php
$srd04 = srand();
var_dump($srd04);
?>