Created
February 28, 2010 23:29
-
-
Save cointilt/317914 to your computer and use it in GitHub Desktop.
Is Requested by Ajax
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 /* Git it! */ | |
/** | |
* Is Requested by Ajax | |
* @return boolean | |
*/ | |
function is_ajax() | |
{ | |
return ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) and ( 'xmlhttprequest' == strtolower ( $_SERVER['HTTP_X_REQUESTED_WITH'] ) or 'activexobject' == strtolower ( $_SERVER['HTTP_X_REQUESTED_WITH'] ) ) ) ?: false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment