All the requesting device properties are stored in the variable $_51d which is populated simply by including the 51Degrees PHP Device Detector script:
$_51d is an associative array built for every requesting device. By using a 51Degrees property name as a key $_51d will return a value or an array of values representing the relevant property value.
// get if the device is a mobile
$is_mobile = $_51d['IsMobile'];
// will be TRUE or FALSE
$hardware_name = $_51['HardwareName'];
// hardware name returns an array,
// so use  to get first value
IsMobile returns a boolean value because it is a boolean type. A full list of properties and their types can be found in the Property Dictionary. If you wish to use the old behaviour of returning a string for every property, set $_fiftyone_degrees_return_strings = TRUE in the 51Degrees.php file.
HardwareName is what is known as a 'list' property (HardwareName property is only available with Premium and Enterprise data files). Some properties can have several values simultaneously that are all returned in an array. HardwareName may have several values as some devices are known by different names in different regions. Note that if a list property only has one value for a particular device it will return an array with a single element.
For a full list of properties and values, see the Property Dictionary. List properties are denoted in the property dictionary with an 'L', for list. To access the property dictionary programatically see Accessing Metadata.
These properties can be used to influence the look of your webpage. The following snippet prints out the device screen dimensions only if the device is a mobile:
if ($_51d['IsMobile'] == 'True')
// the device is a mobile. You could use mobile stylesheets.
// print out the Height and Width of the screen.
echo '<br />ScreenHeight: ' . $_51d['ScreenPixelsHeight'];
echo '<br />ScreenWidth: ' . $_51d['ScreenPixelsWidth'];
Particular list property values can be quickly searched for the in_array function:
if (in_array('audio/mp3', $_51d['CcppAccept']))
// The browser accepts mp3 files.
Note that ‘CcppAccept’ is a premium property. Go to Device Data for more information.