Created
May 9, 2011 21:27
-
-
Save felds/963452 to your computer and use it in GitHub Desktop.
Checks if this is an AJAX request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checks if this is an AJAX request | |
* | |
* @author Luiz "Felds" Liscia <dev@felds.com.br> | |
* return bool | |
*/ | |
function is_ajax() | |
{ | |
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment