Found 1046 Articles for PHP

PHP ceil() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:35:17

227 Views

Definition and UsageThe ceil() function is an in-built function in PHP iterpreter. This function accepts any float number as argument and rounds it up to the next highest integer.This function always returns a float number as range of float is bigger than that of integer.Syntaxceil ( float $num ) : floatParametersSr.NoParameter & Description1numThe number to be rounded up.Return ValuesPHP ceil() function returns the smallest integer value that is bigger 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 5.78 to its next highest integer which ... Read More

PHP bindec() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:34:02

141 Views

Definition and UsageThe bindec() function returns decinmal equivalent of a binary number represented as a string argument. Binary number inside string is interpreted as unigned integer.This function returns a decimal integer. However, it may return float for size reasons.Syntaxbindec ( string $binary_string ) : numberParametersSr.NoParameter & Description1binary_stringA string containing binary number representation. Invalid characters (other than 1 and 0) are ignored.Return ValuesPHP bindec() function returns decimal equivalent of given 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 decimal equivalent of '1101' and returns 13 −Read More

PHP base_convert() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:31:54

369 Views

Definition and UsageThe base_convert() function is versatile utility to convert a number with one base to another. The base is not restricted to binary, octal, hexadecimal or decimal. It can be any number between 2 and 36.First argument to this function is a string that can contain alpha-numeric characters. Digits in a number with base>9 will be represented by alphabets a - z such that 10 is represented by 'a', 11 by 'b' upto 35 by 'z'For example base_convert('1001', 2, 10) converts '1001' from binary to decimal number which is 9Syntaxbase_convert ( string $number , int $frombase , int $tobase ... Read More

PHP atanh() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:29:17

127 Views

Definition and UsageThe atanh() function returns the inverse hyperbolic tangent ratio of given given parameter. In other words, the return value of atanh() is hyperbolic tangent of given parameter. A inverse hyperbolic tangent function is defined as .atanh(x) = 0.5Xlog((1+x)/(1-x))This function returns a float value .Syntaxatanh ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point value whose inverse hyperbolic tangent is to be calculatedReturn ValuesPHP atanh() function returns inverse hyperbolic tangent 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 atanh(pi/4) and returns which is also ... Read More

PHP atan2() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:29:52

152 Views

Definition and UsageThe atan2() function calculates arc tan of two variablesatan2(y, x) returns the arc tangent of the two numbers x and y. although it is similar to atan(y)/atan(x), the signs of both x and y are used to determine the quadrant of the result. Accordingly for values of x and y atan2() isatan(y/x) if x>0atan(y/x)+pi if x>0atan(y/x)-pi if xOutputThis will produce following result −atan2(5, -5) = 2.3561944901923Example Live DemoFollowing program computes atan2(5, 0) and returns 1.570796326795 (M_PI_2) −OutputThis will produce following result −atan2(5, 0) = 1.5707963267949Example Live DemoFollowing example computes atan2(0, 0) and returns 0OutputThis will produce following result −atan2(0, 0) ... Read More

PHP atan() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:24:18

185 Views

Definition and UsageThe atan() function returns the arc tan or tan inverse of arg in radians. atan() is the inverse function of tan(). Therefore if tan(x)=y, atan(y)=x.For example, tan(pi/3)= 1.73205080757 (Squre Root of 3) and atan(1.73205080757)=1.04719755 rad which is equal to pi/3.This function returns a float value .Syntaxatan ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point number whose arc tan is to be calculated.Return ValuesPHP atan() function returns arc tan of given number. It is angle represented in radians. Returned value is between -pi/2 and pi/2PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well ... Read More

PHP asinh() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:22:30

150 Views

Definition and UsageThe asinh() function calculates inverse of hyperbolic sine of given parameter. In other words, the return value of asinh() is hyperbolic sine of given parameter. A inverse hyperbolic sine function is defined asasinh(x) = log(x+sqrt(pow(x, 2)+1))This function returns a float value.Syntaxasinh( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point value whose inverse hyperbolic sine is to be calculatedReturn ValuesPHP asinh() function returns inverse hyperbolic sine 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 asinh(pi/2) which we can verify using the definition −OutputThis will ... Read More

PHP asin() Function

Ranjit Kumar
Updated on 29-Jun-2020 08:20:15

153 Views

Definition and UsageThe asin() function returns the arc sine or sine inverse of arg in radians. asin() is the inverse function of sin(). Therefore if sin(x)=y, asin(y)=x.For example, sin(pi/2)=1 and asin(1)=1.57079633 rad which is equal to pi/2.This function returns a float value.Syntaxasin ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point number whose arc sine is to be calculated. Number should be withing -1 to 1Return ValuesPHP asin() function returns arc sine of given number. It is angle represented 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 ... Read More

PHP acosh() Function

Malhar Lathkar
Updated on 11-Jun-2020 09:51:30

175 Views

Definition and UsageThe acosh() function returns the inverse hyperbolic cosine ratio of given angle in of given parameter. In other words, the return value of asinh() is hyperbolic sine of given parameter. A hyperbolic inverse hyperbolic cosine function is defined as −.acosh(x) = log(x+sqrt(pow(x, 2)-1))This function returns a float value.Syntaxacosh ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point value whose inverse hyperbolic cosine is to be calculatedReturn ValuesPHP acosh() function returns inverse 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.ExampleFollowing example calculates acosh(pi/2) and returns ... Read More

PHP acos() Function

Malhar Lathkar
Updated on 11-Jun-2020 08:36:23

185 Views

Definition and UsageThe acos() function Returns the arc cosine or cos inverse of arg in radians. acos() is the inverse function of cos(). Therefore if cos(x)=y, acos(y)=x.For example, cos(pi/2)=0 and acos(0)=1.57079633 rad which is equal to pi/2.This function returns a float value.Syntaxacos ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point number whose arc cosine is to be calculated. Number should be withing -1 to 1Return ValuesPHP acos() function returns arc cosine of given number. It is angle represented 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 ... Read More

Advertisements