Example 1 — Raise Numbers to a Power
Pass the base first and the exponent second.
<?php
echo pow(2, 3), PHP_EOL;
echo pow(5, 2), PHP_EOL;
echo pow(2, 10), PHP_EOL; How It Works
- pow(2, 3) multiplies 2 by itself three times to get 8.
- pow(5, 2) squares 5 to get 25.
- pow(2, 10) gives 1024, a common value in computing.
- All three results are integers.

