Test - 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 Test.php

  1. <?php
  2. function f($v){
  3.     $f = $v;
  4.     echo $f;
  5.     switch($v){
  6.         case 'c':
  7.             $f = 'u';
  8.             break;
  9.         case 'd':
  10.             $f = 'u';
  11.             break;
  12.         case 'e':
  13.             $f = 'y';
  14.             break;
  15.             
  16.     }
  17.     return $f;
  18. }
  19. function caracteres($c1,$c2,$c3){
  20.     echo $c1;
  21.     $a = $c2;
  22.     $b = $this->f($c1);
  23.     $c = $a;
  24.     
  25.     return array('a'=> $a, 'b'=> $b, 'c'=>$c);
  26. }
  27.  
  28. function ejercicio5(){
  29.     $a = 'a';
  30.     $b = 'b';
  31.     $c = 'c';
  32.     
  33.     $res = $this->caracteres($a,$c,$b);
  34.     
  35.     echo $res['a'];
  36.     echo $res['c'];
  37.     
  38.     exit;
  39. }
  40.  
  41. ejercicio5();
  42.  
  43. ?>
File Description
  • Test
  • PHP Code
  • 17 Feb-2021
  • 621 Bytes
You can Share it: