¿$ _SERVER ['HTTP_X_REQUESTED_WITH'] existe en PHP o no?
En todo el Internet, incluido incluso aquí en Stack Overflow, las personas afirman que una buena manera de verificar si una solicitud es AJAX o no es hacer lo siguiente:
if (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ) {...}
Sin embargo, no veo$_SERVER['HTTP_X_REQUESTED_WITH']
en eldocumentación oficial de PHP
Y cuando trato de hacer lo siguiente:
echo $_SERVER['HTTP_X_REQUESTED_WITH'];
No se emite nada.
¿Estoy haciendo algo mal? Porque realmente me gustaría poder usar$_SERVER['HTTP_X_REQUESTED_WITH']
si está disponible