$v) { if (stripos($k, 'AUTH') !== false) { $found[$k] = substr((string)$v, 0, 12) . '...'; } } echo json_encode([ 'sapi' => PHP_SAPI, 'server_vars' => $found, 'getallheaders_has_auth' => function_exists('getallheaders') && isset(array_change_key_case(getallheaders())['authorization']), ], JSON_PRETTY_PRINT);