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
  • 150,114
  • 66
  • 286
  • 303
NDM
  • 944
  • 9
  • 30
  • 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,221
  • 5
  • 24
  • 39
  • I know this. I am trying to find out how to get the name of the phone, like 'Andy's iPhone ' – NDM Dec 08 '13 at 09:16