
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1060 Articles for PHP

164 Views
Definition and UsageThe 'mt' prefix in function's name stands for Mersenne Twister. The mt_ getrandmax() function returns largest integer that can be used in PHP. This function uses Mersenne Twister Random Number Generator method. Value returned by this function serves as the upper limit for mt_rand() function to generate random number.This function always returns an integer.Syntaxmt_getrandmax ( void ) : intParametersSr.NoParameter & Description1This function needs no parametersReturn ValuesPHP mt_getrandmax() function use Mersenne Twister Random Number Generator method. and returns largest possible integer that can be used in PHP. On 64 bit Windows, the number is 2147483647PHP VersionThis function is available ... Read More

331 Views
Definition and UsageThe min () function returns lowest element in array, or lowest amongst two or more comma separated parameters.Syntaxmin ( array $values ) : mixedOrmin ( mixed $value1 [, mixed $... ] ) : mixedParametersSr.NoParameter & Description1valuesIf only one parameter is given, it should be an array of valaues which may be of same or different types2value1, value2, ..If two or more parameters aregiven, they should be any comparable values of same or different typesReturn ValuesPHP min() function returns lowest value from the array parameter or sequence of values. Standard comparison operators are applicable. If multiple values of different types evaluate ... Read More

552 Views
Definition and UsageThe max () function returns highest element in array, or highest amongst two or more comma separated parameters.Syntaxmax ( array $values ) : mixedOrmax ( mixed $value1 [, mixed $... ] ) : mixedParametersSr.NoParameter & Description1valuesIf only one parameter is given, it should be an array of valaues which may be of same or different types2value1, value2, ..If two or more parameters aregiven, they should be any comparable values of same or different typesReturn ValuesPHP max() function returns highest value from the array parameter or sequence of values. Standard comparison operators are applicable. If multiple values of different types evaluate ... Read More

187 Views
Definition and UsageThe log10 () function calculates base-10 logarithm of a number.Base-10 logarithm is also called common or sandard algorithm. The log10(x) function calculates log10x. It is related to natural algorithm by following equation −log10x=logex/loge10 So thatlog10100=loge100/loge10 = 2In PHP, log10 is represented by log10() functionSyntaxlog10 ( float $arg ) : floatParametersSr.NoParameter & Description1argThe number whose base-10 logarithm is to be calculatedReturn ValuesPHP log10() function returns base-10 logarithm of arg.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates base-10 logarithm of 100OutputThis will produce following result −log10(100)=2Example Live DemoFollowing code calculates base-10 logarithm of ... Read More

141 Views
Definition and UsageHere 1p stands for 1 plus. The log1p () function calculates natural (base-e) logarithm of a 1+number.log1p(x)=log(1+x).log1p is calculated in a way such that its value is accurate even for very small x such that 1+x is nearly equal to xSyntaxlog1p ( float $arg ) : floatParametersSr.NoParameter & Description1argThe number whose 1p logarithm is to be calculatedReturn ValuesPHP log1p() function returns base-1p logarithm of arg+1.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates log1p of 100OutputThis will produce following result −using log() to calculate log(1+100)=4.6151205168413 log1p(100)=4.6151205168413Example Live Demowhere normal log(0) returns ... Read More

306 Views
Definition and UsageThe log () function calculates natural logarithm of a number.Logarithm is inverse of eponential. If 102=100, it means log10100=2. Natural logarithm is calculated with Euler Number e as base. In PHP, the predefined constant M_E gives value of e which is 2.7182818284590452354For example, exp(4.60517018599)=100 (it is also same as e4.60517018599=100). Hence, loge100=4.60517018599In PHP, loge is represented by log() functionSyntaxlog ( float $arg [, float $base = M_E ] ) : float ParametersSr.NoParameter & Description1argThe value whose logarithm is to be calculated2baseDefault value of base is M_E.Return ValuesPHP log() function returns logarithm of arg to base. If base is not given, result is ... Read More

202 Views
Definition and UsageThe lcg_value() function generates a random number between 0 and 1.LCG stands for linear congruential generator. This generator generates a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. This is one of the oldest pseudorandom number generator algorithmsSyntaxlcg_value ( void ) : floatParametersReturn ValuesPHP lcg_value() function returns a pseudo random float value between 0.0 and 1.0, inclusive.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing is the example use of lcg_value() function −OutputThis may produce following result −lcg_value() = 0.45920201711279 lcg_value() = 0.18118693614628

908 Views
Definition and UsageNAN stands for "Not A Number". The is_nan() function checks whether its argument is not a number.Syntaxis_nan ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if infinite or notReturn ValuesPHP is_nan() function returns TRUE if val is "not a number", otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example shows that 100 qualifies as NANOutputThis will produce following result −int(100) bool(false)Example Live DemoValue of log(0) is infinity. Following example verifies if it is NAN −OutputThis will produce following result −float(-INF) bool(false)Example Live DemoSince cos(x) ... Read More

275 Views
Definition and UsageThe is_infinite() function returns a boolean value. It checks whether given parameter is an infinnite number and if so the function returns TRUE, otherwise FALSE. A number is treated as infinite if it is beyond acceptable range of float in PHP.Syntaxis_infinite ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if infinite or notReturn ValuesPHP is_infinite() function returns TRUE if val is outside accepted range of float, otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example shows that 100 is not an ... Read More

142 Views
Definition and UsageThe is_finite() function returns a boolean value. It checks whether given parameter is a legal finite number and if so the function returns TRUE, otherwise FALSESyntaxis_finite ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if finite or notReturn ValuesPHP is_finite() function returns TRUE if val is within accepted range of float, otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example shows that 100 is a finite numberOutputThis will produce following result −100 is a finite numberExample Live DemoValue of log(0) is undefined. ... Read More