How to detect a mobile device in php?? is you ever got this problem during the development to know your device can be detect by user agent.

You have to match keywords to the user agent and get a Boolean true or false for your result.

Below is an best suitable code for detecting mobile devices. You can alter it as desired to match your suitable devices.

 

If you want to detect tablets as well here is the modified one

Few other codes for iOs

 

 

 

Leave a Reply