Jump to content

Detecting Mobile Handset Script


Jetheat
 Share

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
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.