PHP – Hùng Bun – Phạm Việt Hùng

Simplest way to detect a mobile device (PHP)

Cách đơn giản nhất để bạn hiểu rõ hơn code của mình, như dưới đây nhé : $uaFull = strtolower($_SERVER['HTTP_USER_AGENT']); $uaStart = substr($uaFull, 0, 4); $uaPhone = [ '(android|bb\d+|meego).+mobile', 'avantgo', 'bada\/', 'blackberry', 'blazer', 'compal', 'elaine', 'fennec', 'hiptop', 'iemobile', 'ip(hone|od)', 'iris',…

Xem chi tiết