PHP lcg value

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

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 :

  1. echo lcg_value();  

  2. ?>  

Output :

0.39961090888377