轻松实现跳转到WAP页面的PHP代码
作者:jao 发布于:2013-3-17 12:16 分类:PHP教程
<?php
$acceptHeader=$_SERVER['HTTP_ACCEPT'];
if (strpos($acceptHeader,"application/vnd.wap.xhtml+xml")>-1)
Header("Location: 目标URL");
exit;
elseif (strpos($acceptHeader,"application/xhtml+xml")>-1)
$header="application/xhtml+xml";
elseif (strpos($acceptHeader,"text/html")>-1)
$header="text/html";
elseif (strpos($acceptHeader,"text/vnd.wap.wml")>-1) {
Header("Location: 目标URL");
exit;
}
else{
;
}
?>是不是很简单,就这样一段代码就可以实现手机访问自动跳转了... « PHP函数大全(已翻译为简体中文)
|
奇怪的梦»
评论:
我的主页统计
- 建站日期:2012-11-26

2013-03-22 20:29