How to detect mobile devices using PHP

It's only fair to share...Share on Facebook0Share on Google+3Tweet about this on Twitter0Share on LinkedIn6Pin on Pinterest0Digg thisShare on StumbleUpon0

Some times we required to detect mobile devices for a specific functionality. In this tutorial we will explain how to detect mobile device using Mobile Detect PHP class.
Mobile Detect is a lightweight PHP class which we can use to detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

Example 1 – Basic example to check the device is computer, phone or tablet

Example 2 – Detect specific device

Official website for Mobile Detect – Click Here


  1. By Greg


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">