PHP lcg_value() Function

❮ PHP Math Reference

Example

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

<?php
echo lcg_value();
?>
Try it Yourself »

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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.