= 1073741824) ? round($total_size / 1073741824, 2) . " GB" : round($total_size / 1048576, 2) . " MB"; // Respuesta en formato JSON $response = [ "summary" => [ "total_files" => $total_files, "total_size" => $total_size_formatted, "file_counts" => $file_counts ] ]; header('Content-Type: application/json'); echo json_encode($response, JSON_PRETTY_PRINT); ?>