THE WORLD'S LARGEST WEB DEVELOPER SITE

PHP lcg_value() Function

❮ PHP Math Reference

Example

Return a pseudo random number in a range between 0 and 1:

<?php
echo lcg_value();
?>
Run example »

Definition and Usage

The lcg_value() function returns a pseudo random number in a range between 0 and 1.


Syntax

lcg_value();

Technical Details

Return Value: A pseudo random float value in a range between 0 and 1
Return Type: Float
PHP Version: 4+

❮ PHP Math Reference