Ariya - 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 Ariya.php
- <!doctype html>
- <html>
- <body>
- <?php
- // define(B, 15);
- // echo B;
- $number = 5;
- $number_2 = 42;
- // echo "Hello: " . $number . $number_2;
- $a = 1;
- $b = "1";
- // echo $a + intval($b).'<br>';
- $x = 5;
- $y = 6;
- $z = 30;
- $x += 10;
- // echo $x.'<br>';
- $y -= 3;
- // echo $y.'<br>';
- // echo ++$z.'<br>';
- // echo M_PI.'<br>';
- // echo M_E.'<br>';
- $rand = mt_rand(1, 20); // mt_rand
- // echo $rand;
- $str = "Hello";
- // echo 'var: ' . $str.'<br>';
- // echo strtoupper('some').'<br>';
- $v = 10;
- // switch($v) {
- // case 5:
- // echo "Var: 5";
- // break;
- // case 1:
- // echo "Var: 1";
- // break;
- // case 2:
- // echo "Var: 2";
- // break;
- // default:
- // echo "no";
- // }
- $arr = array(1,2,3,4,5,6,7,8,9);
- $arr[8] = 500;
- // echo $arr[8].'<br>';
- // echo $arr[0];
- $foo = [100, 200, 300, 400];
- // foreach ($foo as $elem) {
- // echo $elem.'<br>';
- // }
- $list = ["age" => 50, "name" => 'Anna', "city" => 'London'];
- echo $list["city"];
- $matrix = [
- [1, 3, 4],
- [3, 1000, 6],
- [0, 0, 0]
- ];
- // echo $matrix[1][1];
- ?>
- <form method="post">
- <input type="text" >
- <button type="sumbit">Отправить</button>
- </form>
- </body>
- </html>