📜  检查ajax是否请求php代码示例

📅  最后修改于: 2022-03-11 14:54:23.653000             🧑  作者: Mango

代码示例1
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    /* special ajax here */
    die($content);
}