用于php的存储平台

I created this function with hopes of being able to retrieve platform used to take a web survey. However it's just returning desktop for everything! (even iPhone, etc). Can anyone help please?

You can use simple script - Mobile Detect .It's easy to use:

<?php
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;

// Any mobile device (phones or tablets).
if ( $detect->isMobile() ) {

}

It's better, because this script cover more cases to detect mobile devices.