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.
Result of php executing
Full code of Test.php
- <?php
- //given an array like this:
- $categories = [
- 'Mobile' => [
- 'Phones' => [
- 'Android phones',
- 'Apple iPhone'
- ],
- 'Tablets' => [
- 'Android tablets',
- 'Apple iPad'
- ],
- ],
- 'Photo & Video' => [
- 'Action Cameras' => [
- 'GoPro',
- 'Sony'
- ],
- 'Storage & memory' => [
- 'SD Cards',
- 'USBs'
- ]
- ],
- 'Gaming' => [
- 'Playstation' => [
- 'Playstation 4' => [
- 'Playstation 4 Games',
- 'Playstation 4 Consoles'
- ],
- 'Playstation VR' => [
- 'Playstation VR Games',
- 'Playstation VR Accessories'
- ]
- ],
- 'Xbox One' => [
- 'Xbox One Games'
- ]
- ],
- ];
- /*
- Output a tree/sitemap like this:
- Mobile
- Phones
- Android phones
- Apple iPhone
- Tablets
- Android tablets
- Apple iPad
- Photo & Video
- Action Cameras
- GoPro
- Sony
- Storage & memory
- SD Cards
- USBs
- Gaming
- Playstation
- Playstation 4
- Playstation 4 Games
- Playstation 4 Consoles
- Playstation VR
- Playstation VR Games
- Playstation VR Accessories
- Xbox One
- Xbox One Games
- */