= 32 && $c <= 126) ? $bytes[$i] : '.'; } $results[$file] = [ 'size' => filesize($path), 'first_16_hex' => implode(' ', $hex), 'first_16_ascii' => $ascii ]; } else { $results[$file] = 'File not found'; } } echo json_encode($results, JSON_PRETTY_PRINT); ?>