PHP | lcg_value() Function Last Updated : 03 Jul, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The lcg_value() function is an inbuilt function in PHP which is used to generate the pseudo-random number in the range of (0, 1). Syntax: lcg_value() Parameters Used: This function does not take any parameters. Return Values: This function returns A pseudo random float value in a range between 0 and 1. Errors and Exceptions: Not useful for cryptographic purpose because this function does not generate cryptographically secure values. Below programs illustrate the lcg_value() function Program 1: php <?php // PHP program to illustrate // lcg_value() function //print the value in range between 0 and 1 echo lcg_value(); ?> Output: 0.13542664978974 Program 2: Function prints each time different values and also return type of value. php <?php echo lcg_value(). "\n"; echo lcg_value(). "\n"; echo lcg_value(). "\n"; echo lcg_value(). "\n"; echo lcg_value(). "\n"; echo lcg_value(). "\n"; // for checking types // of return value $x = lcg_value(); //print the type of value returned echo gettype($x); ?> Output: 0.07786871705105 0.70944065438839 0.91109571202142 0.44844141753786 0.63726317430881 0.2004533497305 double Comment More infoAdvertise with us Next Article PHP array_values() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP PHP-math PHP-function Similar Reads PHP | gmp_strval() Function The gmp_strval() is an inbuilt function in PHP which returns the string value of a GMP number. (GNU Multiple Precision: For large numbers). Syntax: string gmp_strval ( GMP $num, int $base ) Parameters: The function accepts two parameters $num and $base as shown above and described below. $num - The 3 min read PHP array_values() Function The array_values() is an inbuilt PHP function is used to get an array of values from another array that may contain key-value pairs or just values. The function creates another array where it stores all the values and by default assigns numerical keys to the values.Syntax:array array_values($array)P 2 min read PHP | is_real() Function The is_real() function is an inbuilt function in PHP which is used to check the given value is a real number or not. Syntax: bool is_real( mixed $var ) Parameters: This function accepts one parameter as mentioned above and described below: $var: It contains the value of variable that need to be chec 2 min read PHP log1p() Function The log1p() is an inbuilt PHP function that returns log(1+number), & when the value of the number is close to zero, then it will compute the way that will provide the accurate result. Syntax: log1p(float $num): floatParameter: This function accepts only a single parameter: num: This parameter sp 1 min read PHP | preg_grep() Function The preg_grep() is an inbuilt function in PHP. It returns the array consisting of the elements of the input array that match with the given pattern. Syntax : array preg_grep ( $pattern, $input [, $flags] ) Parameters Used: The preg_grep() function take three parameters that are described below: $pat 2 min read PHP list() Function The list() function is an inbuilt function in PHP which is used to assign array values to multiple variables at a time. This function will only work on numerical arrays. When the array is assigned to multiple values, then the first element in the array is assigned to the first variable, second to th 2 min read Like