Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php script that detect from user agent what is the device (mobile)?

I am try to write a php script that return the device from the user agent in the header.

the problem that i see that is not simple to do a regular expression, because the different between the device (am i wrong?)

so i want an updated list of mobile device according to the user agent

I found this list : List of user agents for mobile phones

I try to find an updated xml / feed that i can take all the kinds

or other way you think that best to do this .

thanks.

like image 662
Haim Evgi Avatar asked Apr 28 '26 23:04

Haim Evgi


1 Answers

I use this script in a project of mine

http://detectmobilebrowsers.mobi/

Works perfect.

All you need to do in your code is include mobile_device_detect.php and then the function mobile_device_detect() will return to you the device (Android, IPhone, ...) you're running on

like image 105
JochenJung Avatar answered May 01 '26 13:05

JochenJung