Search This Blog

rand() in php

<?php

$random=rand();
$maximum_ramdom_number=getrandmax();
echo 'rendom number :'.$random.'<br>';
echo 'maximum rendom number :'.$maximum_ramdom_number.'<br>';

//   or

echo 'rendom number :'. rand().'<br>';
echo 'maximum rendom number :'.getrandmax();

?>

output :
rendom number :30224
maximum rendom number :32767
rendom number :21769
maximum rendom number :32767

note:

1) for every refresh of the browser the random number is changing . but , the maximum random number is not change

Share Links

Related Posts Plugin for WordPress, Blogger...