lab5.1 - 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 lab5.1.php
- <?php
- $a = 3;
- echo $a, PHP_EOL;
- $a = 10;
- $b = 2;
- echo $a + $b, ' ', $a - $b, ' ', $a * $b, ' ', $a / $b, PHP_EOL;
- $c = 15;
- $d = 2;
- $result = $c + $d;
- echo $result, PHP_EOL;
- $a = 10;
- $b = 2;
- $c = 5;
- echo $a + $b + $c, PHP_EOL;
- $a = 17;
- $b = 10;
- $c = $a - $b;
- $d = 7;
- $result = $c + $d;
- echo $result, PHP_EOL;
- $text = 'Привет, Мир!';
- echo $text, PHP_EOL;
- $text1 = 'Привет, ';
- $text2 = 'Мир!';
- echo $text1 . $text2, PHP_EOL;
- $name = 'Арсений';
- echo 'Привет, ' . $name . '!', PHP_EOL;
- $age = 21;
- echo 'Мне ' . $age . ' лет!';
- ?>