Jump to content
Sign in to follow this  
Jetheat

Detecting Mobile Handset Script

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

Share this post


Link to post
Share on other sites

Why would you care what mobile a client is using?

Share this post


Link to post
Share on other sites

Why would you care what mobile a client is using?

I want to echo the mobile name in my web page like "You have a Samsung Galaxy Note II".

 

Its for marketing purposes.

 

Question is, how do I do that?

 

JH

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.