2

I only need to detect if is mobile device or not...

hakre
  • 193,403
  • 52
  • 435
  • 836
Alejandro
  • 421
  • 1
  • 4
  • 13
  • possible duplicate of [PHP mobile browser detection?](http://stackoverflow.com/questions/3817155/php-mobile-browser-detection) – Gordon Nov 17 '10 at 23:18
  • hi... when i inserted the answer the stackoverflow ajax autosuggest didnt show me that question... – Alejandro Nov 17 '10 at 23:26

3 Answers3

5

This is a good class to try:

http://code.google.com/p/php-mobile-detect/

wajiw
  • 12,239
  • 17
  • 54
  • 73
  • hi thanks a lot im getting this error when in invoke the function – Alejandro Nov 17 '10 at 23:27
  • hi thanks a lot im getting this error: Notice: Undefined variable: accept in C:\Servidor_Apache\htdocs\INTERSOLUCIONESCR\Descuenticos\ver3\mobile\Mobile_Detect.php on line 40 Notice: Undefined property: Mobile_Detect::$isIphone in C:\Servidor_Apache\htdocs\INTERSOLUCIONESCR\Descuenticos\ver3\mobile\Mobile_Detect.php on line 80 when in invoke the function isMobile() What that means???? – Alejandro Nov 17 '10 at 23:37
  • It's a known bug: http://code.google.com/p/php-mobile-detect/issues/detail?id=7 In the ticket it shows how to fix it. – wajiw Nov 17 '10 at 23:39
1

You might want to try something like this if you want to know which device it is: http://www.hand-interactive.com/resources/detect-mobile-php.htm

Or if you don't care: http://mobiforge.com/developing/story/lightweight-device-detection-php

Andrew M
  • 4,208
  • 11
  • 42
  • 67
0

This is updated version of the PHP Mobile Detect:

http://code.google.com/p/php-mobile-detect2/

Sergej Brazdeikis
  • 1,323
  • 10
  • 11