我的主页上有一个简单的重定向,它对智能手机或平板电脑上的用户做出反应.该类正在工作,并在智能手机上打开侧面时返回true.
因此,如果我在if语句中写回声,它就会被回显.但重定向不起作用,我无法理解它.任何人都知道我错过了什么?
include ('includes/Mobiledetecter.php');
$detect = new Mobiledetecter;
//
if($detect->isMobile() or $detect->isTablet()) {
header('Location: http://www.example.com/');
}
Run Code Online (Sandbox Code Playgroud)