How to Detect Mobile/Tablet Device in PHP | Server - Http user agent

Описание к видео How to Detect Mobile/Tablet Device in PHP | Server - Http user agent

How to Detect Mobile/Tablet Device in PHP | Server - Http user agent

In this video, you will learn how you can detect mobile, tablet and browser in php using http user agent

You can check mobile and android string


$devicecheck= is_numeric(strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"mobile"));
$devicecheck_android= is_numeric(strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"android"));

if($devicecheck==1 OR $devicecheck_android==1)
{
echo 'You are using a mobile device';
}
else{
echo 'You are using a browser';
}


you can detect mobile device using this code in php
Also, you can detect tablet using this code in php

#html5 #knowledgethrusters

Комментарии

Информация по комментариям в разработке