Monday, December 15, 2008

How to find the power of a number (Exponential) using php

Following code will show you how to find the power of a number using php.
The function used to do this is pow() function.
pow(base, exponent)


<?php

//first parameter is the base
//second parameter is the exponent

echo pow(2, 2); // 4
echo pow(2, 3); // 8
echo pow(3, 2); // 9

?>



Get custom programming done at GetAFreelancer.com!

No comments:

Post a Comment