![]() | Lê Văn Đức ![]() 19-07-2017 |
Share Code PHP Nhận Diện Smartphone. Bạn có thể sử dụng để viết giao diện hoặc hiển thị nội dung dành riêng cho người dùng smartphone.function smartphone_check(){
$agent = strtolower($_SERVER['HTTP_USER_AGENT'">);
If (preg_match("/(iPhone|Android|webOS|BlackBerry|iPod|iPad|windowphone|lumia)/i", $agent))
return true;
else
return false;
}
$smartphone = smartphone_check();If($smartphone){
Nội dung chỉ người dùng smartphone nhìn thấy
}

