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



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/php/function-reference/lcg_value.php