Mobile Detect with PHP


In this modern era, the web has now gone mobile. i.e. website are made keeping in mind that people will be accessing them via their mobiles phones and tablets. Although website are made with the css media queries which respond to the devices, it does not gives minute details of the user devices like their version, platform, etc. Using Mobile detect with PHP library we can get details of their devices like their platform, versions, browsers etc. It helps in keeping track of the data which will benefit the website owner.

View Demo

What is Mobile Detect Library?

Mobile Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment. It is a pure PHP library and works on server side, it is not a replacement for Responsive Web Design (media queries) or other forms of client-side feature detection. This library has been used on various open source project like Prestashop, concrete5.

Detect your device with Mobile Detect

Mobile Detect Library will check whether your device is a mobile, tablet or a computer. To use it in your program use the code below.

Check if the device is mobile (phone or tablet).

Check if the device is tablet.

Check if the device is phone, not tablet.

Check device platform like iphone, android phone, Windows, Symbian.

There are other custom detection methods to do more task. Have a look at few of them.

Check out the demo and download the script below.

View Demo


About Author

Entrepreneur & Dreamer

I am a passionate Software Professional, love to learn and share my knowledge with others.

Software is the hardware of my life.


Leave A Reply

CommentLuv badge

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.