Skip to content

Instantly share code, notes, and snippets.

@michal
Created December 13, 2010 11:38
Show Gist options
  • Save michal/738925 to your computer and use it in GitHub Desktop.
Save michal/738925 to your computer and use it in GitHub Desktop.
php is ajax request?
function isAjax() {
return (isset($_SERVER['HTTP_X_REQUESTED_WITH'])
&& $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') ? true : false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment