function isAjaxCallback if isset _SERVER HTTP_X_REQUESTED_WIT _SERVER

1
2
3
4
5
6
7
function isAjaxCallback()
{
if( isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest" )
return true;
else
return false;
}