📜  在php代码示例中检测页面realod

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

代码示例1
$pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';
 
if($pageWasRefreshed ) {
  //do something because page was refreshed;
} else {
  //do nothing;
}