Jump to content

Detecting Mobile Handset Script


Jetheat

Recommended Posts

I have a php script that detects the user's mobile phone and browser and some other stuff.

To display this info, I use: <?php echo htmlentities($_SERVER['HTTP_USER_AGENT']); ?>

But this outputs a lot more than I need. It outputs the handset, the browser, the version etc... like this:
Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53

Does anyone know what I need to change in the script just so I can have it display the handset name?
All I want it to do is say something like "You have a Samsung Galaxy Note II"


I have attached the mobile_detect script but I dont know what to edit because I don't really know php.

Appreciate the help,

JH

Mobile_Detect.php.zip

Link to comment
https://forums.phpfreaks.com/topic/292062-detecting-mobile-handset-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.