Return to Snippet

Revision: 26612
at May 4, 2010 05:27 by Scriptshit


Initial Code
/**
 * Returns true if the request comes from an ajax call
 *
 * @return bool
 * @author Robert Agthe
 */
function is_ajax()
{
	return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')?true:false;
}

Initial URL

                                

Initial Description

                                

Initial Title
ajax call or no ajax call

Initial Tags
ajax, js, php, textmate

Initial Language
PHP