PHP lcg_value()Functions

PHP Math 参考手册PHP Math Reference Manual

Examples

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

<?php
echo lcg_value();
?>

Run Example »

Definition and Usage

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


Syntax

lcg_value();

Technical Details

Return value: A pseudo-random floating-point value in the range (0, 1).
Return type: Float
PHP version: 4+


PHP Math 参考手册PHP Math Reference Manual Other Extensions