The lcg_value() function returns a pseudo random number in a range between 0 and 1.
PHP lcg_value() Function has the following syntax.
lcg_value();
None
Item | Description |
---|---|
Return Value | A pseudo random float value in a range between 0 and 1 |
Return Type | Float |
Return a pseudo random number in a range between 0 and 1:
<?php
echo lcg_value();
?>
The code above generates the following result.