rugyguvhbuiuygvbh juhiguytfgv - 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 rugyguvhbuiuygvbh juhiguytfgv.php
- <?php
- error_reporting(E_ERROR);
- $tree = '{"name": "A","items" : [{"name": "B","items" : [{"name": "D"},{"name": "E","items" : [{"name": "G"}]}]},{"name": "C","items" : [{"name": "F","items" : [{"name": "H"},{"name": "I"}]}]}]}';
- $tree = json_decode($tree, 1);
- treeTraversal($tree);
- function treeTraversal(&$tree)
- {
- if (!$tree['items']) {
- return;
- }
- $tree['count'] = count($tree['items']);
- foreach ($tree['items'] as &$item) {
- treeTraversal($item);
- }
- }
- print_r($tree);