- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 1046 Articles for PHP
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
137 Views
Definition and UsageThe name fmod stands for floating modulo . This function returns remainder of division of two floating point numbers. If x/y results in i as division and r as remainder so thatx = y*i+r In this case, fmod(x, y) returns rSyntaxfmod ( float $x , float $y ) : float ParametersSr.NoParameter & Description1xThis parameter forms numerator part of division expression2yThis parameter forms denominator part of division expressionReturn ValuesPHP fmod() function returns floating point remainder of the act of division of x by y. Remainder carries sign of x.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
623 Views
Definition and UsageThe floor() function is another in-built function in PHP iterpreter. This function accepts any float number as argument and rounds it down to the next lowest integer.This function always returns a float number as range of float is bigger than that of integer.Syntaxfloor ( float $num ) : floatParametersSr.NoParameter & Description1numThe number to be rounded down.Return ValuesPHP floor() function returns the largest integer less than or equal to given parameter.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example rounds 15.05 to its next highest integer which is 15OutputThis will ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
31 Views
Definition and UsageThe expm1() function returns exp(number) - 1, computed in a way that is accurate even when the value of number is close to zero, a case where 'exp (number) - 1' would be inaccurate due to subtraction of two numbers that are nearly equal.expm1(x) = exp(x) - 1This function returns a float value .Syntaxexpm1 ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point number whose expm1 is to be calculated.Return ValuesPHP expm1() function returns a floating point value.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates expm1(2) ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
81 Views
Definition and UsageThe exp() function calculates exponent of e that is Euler Number. PHP has a predefined constant M_E that represents Euler Number and is equal to 2.7182818284590452354. Hence, exp(x) returns 2.7182818284590452354xThis function always returns a float.Syntaxexp ( float $arg ) : floatParametersSr.NoParameter & Description1arga floating point number to raise e toReturn ValuesPHP exp() function returns the Euler Number e raised to given arg. Note that e is base of natural algorithm. The exp() function is inverse of natural logarithm.Hence, if logex = y, then ey=xPHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
148 Views
Definition and UsageMost trigonometric functions like sin, cos, tan etc require angle argument in radians. The deg2rad() function proves useful in conversion of degrees to radians.This function returns a float number such that number=deg2rad(x) where is angle in degrees. angle in radian = angle in deg *180/piFor example deg2rad(30) is equal to 0.5235987755983 radiansSyntaxdeg2rad ( float $number ) : floatParametersSr.NoParameter & Description1numberA float number reprsenting angle in degreesReturn ValuesPHP deg2rad() function returns a float number that represents angle in radians.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates radian equivalent ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
64 Views
Definition and UsageThe decoct() function returns a string that contains octal equivalent of given decimal number argument.This function returns a string with octal characters (0 to 7).Syntaxdecoct ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent octal representationReturn ValuesPHP decoct() function returns an octal number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 1001 and returns '1751' −OutputThis will produce following result −decoct(1001) = 1751Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 100.55 is ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
100 Views
Definition and UsageThe dechex() function returns a string that contains hexadecimal equivalent of given decimal number argument.This function returns a string with hexadecimal characters.Syntaxdechex ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent hexadecimal representationReturn ValuesPHP dechex() function returns a hexadecimal number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 1001 and returns '3e9' −OutputThis will produce following result −dechex(1001) = 3e9Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 100.55 is treated as 100 ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
149 Views
Definition and UsageThe decbin() function returns a string that contains binary equivalent of given decimal number argument.This function returns a string with binary digits.Syntaxdecbin ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent binary representationReturn ValuesPHP decbin() function returns a binary number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 13 and returns '1101' −OutputThis will produce following result −decbin(13) = 1101Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 9.99 is treated as 9 ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
130 Views
Definition and UsageThe cosh() function returns the hyperbolic cosine ratio of given angle in radians. In trigonometry, hyperbolic cosine ratio is defined as .cosh(x) = (ex – e-x))/2This function returns a float value .Syntaxcosh ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point value that represents angle in radiansReturn ValuesPHP cosh() function returns hyperbolic cosine ratio of given parameter.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates cosh(pi/2) and returns 2.5091784786581 which is also the result of formula (ex + e-x))/2 −OutputThis will produce following result −cosh(M_PI_2) = 2.5091784786581 ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/211197/profile/60_4699-1591856239.jpg)
218 Views
Definition and UsageThe cos() function returns the cosine ratio of given angle in radians. In trigonometry, cosine of an angle is defined as ratio of lengths of adjacent side and hypotenuse.cos(x) = adjacent/hypotenuseIf x=90 degree, cos(x) = 0.This function returns a float value.Syntaxcos ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point value that represents angle in radiansReturn ValuesPHP cos() function returns cosine ratio of given parameter.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates cos(pi/2) and returns 6.1232339957368E-17 (very close to 0). Cosine ratio of 90 deg is ... Read More