if(strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’])==’xmlhttprequest’){
echo "The request is from an Ajax Call";
}else{
echo "The request is not from an Ajax Call";
}
?>
There you go. You now know how to check whether request made to file is from an Ajax Call or not in PHP.