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.  
  3. $path = "/marke/audi";
  4. $path = ltrim($path, '/');
  5.  
  6. $automarken = array(
  7.     'audi' => array(
  8.         'info' => 'Das ist Audi',
  9.         'titel' => 'Audi'
  10.         ),
  11.     'bmw' => array(
  12.         'info' => 'Das ist BWM',
  13.         'titel' => 'BMW'
  14.         )
  15. );
  16.  
  17. $request = explode('/', $path);
  18. print_r($request);
  19. print $request[1];
  20.  
  21. if($request[0] == 'marke' ) {
  22.     if(!empty($request[1])) {
  23.         //print_r $automarken[$request[1]];
  24.     }
  25. } else {
  26.     print 'Nichts ausgewählt'; 
  27. }
  28.  
File Description
  • test
  • PHP Code
  • 09 Apr-2018
  • 488 Bytes
You can Share it: