0

In objective-c you can get the phone name (e.g My iPhone 5) with [[UIDevice currentDevice] name].

I have trying to find out for two days if it is possible to get it from js or php but saw only references to OS version or device model.

laalto
  • 137,703
  • 64
  • 254
  • 280
NDM - Mobile DEV
  • 864
  • 8
  • 28
  • doing it on the browser you can do this: http://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-handheld-device-in-jquery – samfr Dec 08 '13 at 09:16

1 Answers1

0

You can parse http user agent string by php:

if(strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
echo "You're using iPhone.";
}

if(strstr($_SERVER['HTTP_USER_AGENT'], 'iPod')) {
    echo "You're using iPod.";
}

if(strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
    echo "You're using iPad.";
}

if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'android')) {
echo "You're using Android device.";
}

Find more on David Walsh's blog: 1, 2, 3.

aksu
  • 5,035
  • 5
  • 21
  • 38