0); $result[] = [ 'id' => strval($row['id']), 'text' => $row['text'] ? $row['text'] : $row['name'], 'children' => $hasChildren, 'data' => [ 'name' => $row['name'], 'href' => $row['href'] ], 'icon' => $hasChildren ? 'fas fa-folder text-warning' : 'fas fa-file text-secondary' ]; } mysqli_close($conn); echo json_encode($result, JSON_UNESCAPED_UNICODE); ?>