How to validate AJAX requests in Zend Framework. There is a function in request class, to use instead of comparing the $_SERVER['HTTP_X_REQUESTED_WITH'] directly. This can be beneficial for security, so you can validate that the request is ajax request.
Source code viewer
public function myAction() { if ($this->getRequest()->isXmlHttpRequest()) { // Code run during AJAX request... } }Programming Language: PHP