PHP lcg_value() Function

Definition

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

Syntax

PHP lcg_value() Function has the following syntax.

lcg_value();

Parameter

None

Return

Item Description
Return Value A pseudo random float value in a range between 0 and 1
Return Type Float

Example

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


<?php
echo lcg_value();
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions