Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello..
i can not understand pow in php
please explain this function
#thanks

What I have tried:

<?php
pow($num*$num)
echo"$num"
>
Posted
Updated 7-Sep-17 3:00am
Comments
CPallini 7-Sep-17 9:12am    
Probably you meant
pow($num,2);
Patrice T 7-Sep-17 9:20am    
What you don't understand in documentation ?

1 solution

The function is explained in the official documentation: PHP: pow - Manual[^].

As you can see, it takes two arguments (base and exponent), and returns the result of the performed operation baseexponent.

If you for example want to calculate the power of a number to the base 10, use something like
PHP
$result = pow($num, 10);
echo "$result";
or just
PHP
echo pow($num, 10);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900