w3resource

PHP: lcg_value() function

Description

The lcg_value() function is used to get a pseudo random number in the range of 0 and 1.

Version

(PHP 4 and above)

Syntax

lcg_value ()

Return value

A pseudo random value in the range of (0, 1)

Value Type: Float.

Example:

<?php
echo lcg_value();
?>

Output:

0.39961090888377 

View the example in the browser

See also

PHP Function Reference

Previous: is_nan
Next: log10



Follow us on Facebook and Twitter for latest update.