In Zend Framework and other framework such as Symfony, there is a method named isXMLHttpRequest() to determine this is XMLHttpRequest or not. I wonder that how can framework or PHP distinguish between XmlHttpRequest and HttpRequest?
if($this->_request->isXmlHttpRequest())
{
//code here
}
From the documentation: