PHP實現頁面的跳轉及非微信瀏覽器禁止訪問

<?php
/*
* Writed by Luo Ning
* Blog: http://www.luoning.me
*/
$useragent = addslashes($_SERVER['HTTP_USER_AGENT']);
if(strpos($useragent, 'MicroMessenger') === false && strpos($useragent, 'Windows Phone') === false ){
///echo " <center>非微信瀏覽器禁止訪問</center>";
header("Location: http://www.luoning.me");
exit;

}else{ 
echo "真乖,就是要用微信訪問嘛!";
}

?>
相關文章
相關標籤/搜索