2_kr - 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.
Result of php executing
Full code of 2_kr.php
- <!DOCTYPE html>
- <html lang="ru">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Таблица степеней</title>
- <style>
- table {
- border-collapse: collapse;
- width: 50%;
- margin: 20px;
- }
- table, th, td {
- border: 1px solid black;
- }
- th, td {
- padding: 10px;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <?php
- // можно и рандомно, но тут конкретно не указывается
- $array1 = [5, 4, 4, 3, 6];
- $array2 = [7, 3, 5, 2, 4];
- echo "<h2>Таблица степеней</h2>";
- echo "<table>";
- echo "<tr><th>Число из массива 1</th><th>Число из массива 2</th><th>Результат</th></tr>";
- for ($i = 0; $i < count($array1); $i++) {
- $result = pow($array1[$i], $array2[$i]);
- echo "<tr><td>{$array1[$i]}</td><td>{$array2[$i]}</td><td>{$result}</td></tr>";
- }
- echo "</table>";
- ?>
- </body>
- </html>
File Description
- 2_kr
- PHP Code
- 14 Feb-2024
- 1.13 Kb
You can Share it:
Latest PHP Pastes