Latest web development tutorials

PHP lcg_value () function

PHP Math Reference PHP Math Reference

Examples

Back in the range of (0, 1) of a pseudo-random number:

<?php
echo lcg_value();
?>

Running instance »

Definition and Usage

lcg_value () function returns the range (0, 1) of a pseudo-random number.


grammar

lcg_value();

technical details

return value: In the range of (0, 1) of a pseudo-random floating-point value.
Return type: Float
PHP version: 4+


PHP Math Reference PHP Math Reference