0

How do i determine whether the page is opened using a tablet or a mobile phone, i get that you can check for iPhone, iPad, etc. but is there a more distinct identifier in determining whether the page was opened using mobile, or tablet?

I'm using this so i can get the width of the page, but if there is a more efficient way of getting the current width of the page, do let me know

thank you :)

magicianiam
  • 1,474
  • 7
  • 33
  • 70
  • 1
    http://stackoverflow.com/questions/6636306/mobile-browser-detection http://stackoverflow.com/questions/3817155/php-mobile-browser-detection – Mike B Dec 17 '12 at 18:22
  • 1
    and if they're coming in using a google Nexus 10, which has a resolution of 2560x1600? That's far higher than my desktop monitors, yet one's mobile and one's not... – Marc B Dec 17 '12 at 18:28
  • @MarcB true, how will you go around it then? – magicianiam Dec 17 '12 at 18:47
  • 1
    "mobile" is getting to be a pointless definition, since your average "about a year old" smartphone has screens with higher resolution than your average cheapie "good enough for grandma" desktop machine. mobile v.s. "full" made sense when mobile meant a dinky 150x300 screen viewing via WAP. – Marc B Dec 17 '12 at 19:06

1 Answers1

1

See http://php.net/manual/en/function.get-browser.php You may need some JavaScript to get the dimensions of the viewport.

Ray Paseur
  • 2,106
  • 2
  • 13
  • 18