Home > Article > Backend Development > How to express several times in php
How to express several powers in php: first create a PHP file; then create two variables; finally use the pow() function to find $x raised to the $nth power, and save the result in the $res variable Just hit it.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
php finds the Nth power of a number
Create a new php file, named test.php, to explain how to find the Nth power of a number in php.
In the test.php file, use the header() method to set the encoding format of the page to utf-8 to avoid outputting Chinese garbled characters.
In the test.php file, create two variables, where the $x variable is the desired number and the $n variable is the Nth power number.
In the test.php file, use the pow() function to find the $nth power of $x, and the result is saved in the $res variable.
In the test.php file, use echo to output the calculated results.
Open the test.php file in the browser to view the results.
Recommended study: "PHP Video Tutorial"
The above is the detailed content of How to express several times in php. For more information, please follow other related articles on the PHP Chinese website!