Simple way to detect device type with PHP

Today we are going to learn how to check the browsing device is computer or  mobile or tablet or bot  with PHP. For this tutorial  i have used simple function to detect the device.


Detection is application for

  • Mobile
  • Tablet
  • Computer
  • Bot

For this tutorial i used following device type array

I did device detection is based on “HTTP_USER_AGENT”

Complete code here

You can use this function wherever you want like frameworks like codeigniter, cakephp etc…

Demo and Download


Please don’t forget to share and subscribe to latest updates of the blog .