php判断客户端类型
1.composer第三方扩展包 jenssegers/agent
2.使用composer安装
composer require jenssegers/agent
2.1在config\app.php中注册服务提供者
Add the service provider in config/app.php:
Jenssegers\Agent\AgentServiceProvider::class,
And add the Agent alias to config/app.php:
'Agent' => Jenssegers\Agent\Facades\Agent::class,
3.在控制器中的使用
3.1引用类
use Jenssegers\Agent\Agent;
3.2实例化
Agent对象
$agent = new Agent();
3.3运用实例化之后对象的判断
Agent::is('Windows');
Agent::is('Firefox');
Agent::is('iPhone');
Agent::is('OS X');
3.4,第二种判断方式
Agent::isAndroidOS();
Agent::isNexus();
Agent::isSafari();

浙公网安备 33010602011771号