PHP exp() Function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report Euler's Number or commonly known as e is a very popular irrational number which approximates to 2.718281828, and is one of the most important mathematical constants. e is the base of the Natural system of logarithms. The exponential values are broadly used in many occasions such as Compound Interests, Bernoulli trials, Normal Distribution, Calculus and many more. The exp() function is used to calculate e raised to the power of the given argument. Syntax: float exp($power) Parameters: The function takes a single parameter $power which defines the power e has to be raised to. Return Type: This function returns the value of e raised to the power of the given argument as a float. Examples: Input : $power = 0; Output : 1 Input : $power = 1; Output : 2.718281828459 Below program illustrates the working of exp() in PHP: PHP <?php // PHP code to illustrate the working of exp() Function for($i=-2;$i<=2;$i++) echo 'e^'.$i.' = '.exp($i)."\n"; ?> Output: e^-2 = 0.13533528323661 e^-1 = 0.36787944117144 e^0 = 1 e^1 = 2.718281828459 e^2 = 7.3890560989307 Important points to note: exp() function is a very popular method to calculate exponential values. log() function is the functional counterpart of exp(). Reference: http://php.net/manual/en/function.exp.php Comment More infoAdvertise with us Next Article PHP exp() Function P PronabM Follow Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Practice Tags : Misc Similar Reads PHP | exit( ) Function The exit() function in PHP is an inbuilt function which is used to output a message and terminate the current script. The exit() function only terminates the execution of the script. The shutdown functions and object destructors will always be executed even if exit() function is called. The message 2 min read PHP explode() Function The explode() function in PHP is used to split a string into an array based on a specified delimiter. This function is commonly used when you need to break down a string into individual parts. The explode() function is simple to use and highly efficient for splitting strings.Syntax:explode(string $d 4 min read PHP end() Function The end() function is an inbuilt function in PHP and is used to find the last element of the given array. The end() function changes the internal pointer of an array to point to the last element and returns the value of the last element.Syntax:end($array)Parameters:This function accepts a single par 2 min read PHP eval() Function PHP eval() function in PHP is an inbuilt function that evaluates a string as PHP code. Syntax: eval( $string ) Parameters: This function accepts a single parameter as shown in the above syntax and described below. $string: It must consist of a valid PHP code to be evaluated but should not contain op 2 min read PHP each() Function The each() function is an inbuilt function in PHP and is used to get the current element key-value pair of the given array to which the internal pointer is currently pointing. After returning the key and value of the current element the internal pointer is incremented by one in the array. Note: You 2 min read Like