Home  >  Article  >  Backend Development  >  How to express several times in php

How to express several times in php

藏色散人
藏色散人Original
2021-05-18 09:37:273277browse

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.

How to express several times in php

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.

How to express several times 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.

How to express several times in php

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.

How to express several times in php

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.

How to express several times in php

In the test.php file, use echo to output the calculated results.

How to express several times in php

Open the test.php file in the browser to view the results.

How to express several times in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn