The is_ajax function in PHP is used to determine if the current HTTP request is an AJAX request or not. It returns true if the request is made using the XMLHttpRequest object, and false otherwise.
Example 1:
Example 2:
'success'];
echo json_encode($data);
} else {
// this is not an AJAX request
echo "This is not an AJAX request";
}
?>
The function is_ajax is not a part of any specific package library, it is a standard PHP function.
PHP request::is_ajax - 30 examples found. These are the top rated real world PHP examples of request::is_ajax extracted from open source projects. You can rate examples to help us improve the quality of examples.