Home > Backend Development > PHP Tutorial > PHP CI 框架 怎么在访问的是否区分手机 和 电脑访问

PHP CI 框架 怎么在访问的是否区分手机 和 电脑访问

WBOY
Release: 2016-06-23 14:28:15
Original
968 people have browsed it

php 框架

如:
电脑访问的话,就直接显示 a.php 页面
手机访问的话,就显示 b.php 页面

回复讨论(解决方案)

$_SERVER['HTTP_USER_AGENT']

函数参考
$this->load->library('user_agent');
if ($this->agent->is_mobile())
{
   $this->load->view('a.php',$this->getpagedata());
}
else 
{
    $this->load->view('b.php',$this->getpagedata());
}

CI 框架是有自带的,已经搞定了,分享给大家

CI 框架是这么调试图的? 需要加. php?

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template