Identifying Smartphone / Non-Smartphone for php

Facebook seems to handle this, I checked a bit in WURFL, but it seems like a very expensive process. I also checked: url . While it has a good list of user agents, I am trying to determine which ones are smartphones and which are not.

facebook is pushing non-smartphones to a different site than their smartphones. Trying to find out if there is an easy way to do this.

+2


source to share


3 answers


You should look into Tera-WURFL , which is basically WURFL serialized data in a MySQL database. Much better than XML WURFL.

There is also another mobile device db: Device Atlas .



What you can do is find the lowest common denominator for smartphones and then create your own stripped-down version of WURFL / Device Atlas that is much less resource intensive and faster to check and go from there.

+2


source


Screen size should be a somewhat reliable indicator. Non-smartphones tend to have lower 320x240 resolutions, although I would of course check some older smartphones.



+1


source


Try wurfl-php-1.4.2.0

$isPhone = $device->getCapability("can_assign_phone_number");
$isSmarty = $device->getCapability("device_claims_web_support");

      

If it's a phone and a smartphone, it's a smartphone. If it's a phone and it's not smart, it's not a smartphone

0


source







All Articles