piramide - 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 piramide.php
- <?php
- $stacks = readline("Hoeveel stapels wil je hebben?" . PHP_EOL);
- echo " " . '*';
- for ($i = 0; $i < $stacks; $i++) {
- echo '*' . '*';
- echo PHP_EOL;
- }
- echo "Stapels" . PHP_EOL;
- $stack = readline();
- echo "" . "*" . PHP_EOL;
- for ($rij = 0; $rij <= $stacks; $rij++) {
- $stacks = $stacks . "*";
- echo $stapels . PHP_EOL;
- }