Categorized | Uncategorized

How to Detect Mobile Devices: iPhone Android Google Phone Browser

This article was written by: Bruce Walls


PHP Device Detection Homepage Redirect Script: www.developphp.com PHP Alternating CSS Style Sheets Script: www.developphp.com Browser Detect Using Javascript: www.developphp.com Learn a few methods of detecting mobile phones, devices, handhelds, and then offer a standardized mobile website layout if those devices are detected. This lesson is brought to you free by the gang at www.developphp.com

20 Responses to “How to Detect Mobile Devices: iPhone Android Google Phone Browser”

  1. jujumediazone says:

    So, all I do copy and paste the PHP script onto my homepage, before any of the other code. It’s not working for me. I’m not sure what the problem is. Could it be my location URL? you have “android_home.html”?

  2. jnferree says:

    Great info Adam – What’s you take on Wapple and MoFuse whom as I understand it provide (come with) the code needed to automatically detect which mobile device is hitting the site and then renders the proper code automatically?

  3. ThaPaddeProductions says:

    @ThaPaddeProductions Never mind, it’s works now :)

  4. ThaPaddeProductions says:

    The video want load for me :(

  5. marcosaurea says:

    I was looking for this tut, GREAT STUFF!!!!

  6. zeekle says:

    Great! Does Android cover “everybody else” as far as mobile devices are concerned or do I need to add to this script more agents? Thanks again for the great tute.

  7. gyromudd says:

    works like a charm, thanks adam. i gotta tell ya that steve jobs and his dislike of flash makes no sense to me. mac folks seem to be having a hard time defending him these days.

  8. CptRor says:

    “in my boouuth”

  9. tomongous says:

    For some reason the Moto Droid has ‘Android’ in its UA string… you might want to do ‘/android/i’ or do and another case if you’re attempting to detect the 2.1 Droid phone.

  10. ssuhotcoco25 says:

    This is great! Added to my snippets!!

  11. Gridlock812 says:

    good stuff thanks!

  12. sentient1705 says:

    nice!!!

  13. littlestar1562 says:

    amazing adam

  14. kirby1fan says:

    lol, i just found out that your intro is in super mario galaxy when in the begining bowsers ship comes =D

  15. flashbuilding says:

    You have to find out the “user agent” string for the target device you are trying to detect.

  16. specialchannel says:

    what if your just useing a normal cell phone and now a iphone

  17. DariusDaGreat86 says:

    you should put the example URLs in the description box. Thanks

  18. Seryosin says:

    Helpful as always. TnQ Adam. :>

  19. flashbuilding says:

    Thank you sir… we’ll try to get a few free templates made up.

  20. MrShawnlloyd says:

    great info adam

Trackbacks/Pingbacks


Leave a Reply