хххх - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of хххх.php

  1. <?php
  2. // Функция для возведения числа в степень
  3. function power($base, $exponent) {
  4.     return pow($base, $exponent);
  5. }
  6.  
  7. // Переменные для примера
  8. $a = 2;
  9. $b = 3;
  10. $c = 4;
  11.  
  12. // Вывод результатов для примера
  13. echo "{$a} в степени {$b} = " . power($a, $b) . "<br>";
  14. echo "{$a} в степени {$c} = " . power($a, $c) . "<br>";
  15. // Дополнительные примеры
  16. echo "5 в степени 2 = " . power(5, 2) . "<br>";
  17. echo "10 в степени 3 = " . power(10, 3) . "<br>";
  18. ?>
  19.  
File Description
  • хххх
  • PHP Code
  • 05 Dec-2023
  • 575 Bytes
You can Share it: