Ajax / Article / CodeIgniter / JavaScript / JQuery / PHPHow to check if the request is an AJAX request with PHP September 11, 2016 Chandan SharmaComment on How to check if the request is an AJAX request with PHPif (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ) { // This is ajax request. // write your code here. }Share this:FacebookX