function getMobileInformation() { $detect = new Mobile_Detect(); $isMobile = "false"; $isTablet = "false"; $mobileOS = ''; $mobileVersion = ''; $versionIsSufficient = false; if ($detect->isMobile()) { $isMobile = "true"; if ($detect->isTablet()) { $isTablet = "true"; } if ($detect->isiOs()) { $mobileOS = 'iOS'; $mobileVersion = $detect->version('iOS'); $versionArray = explode('_', $mobileVersion); if ($versionArray[0] >= 6) { $versionIsSufficient = true; } } elseif ($detect->isAndroidOS()) { $mobileOS = 'Android'; $mobileVersion = $detect->version('Android'); $versionArray = explode('.', $mobileVersion); if ($versionArray[0] >= 4 && $versionArray[1] >= 1) { $versionIsSufficient = true; } } elseif ($detect->isWindowsPhoneOS()) { $mobileOS = 'WindowsPhoneOS'; $mobileVersion = $detect->version('WindowsPhoneOS'); } else { $mobileOS = 'Other mobile OS'; $mobileVersion = 'NONE'; } } return array('isMobile' => $isMobile, 'isTablet' => $isTablet, 'mobileOS' => $mobileOS, 'mobileVersion' => $mobileVersion, 'mobileIsSufficient' => $versionIsSufficient); }