function getStyleSheetFile($deviceData)
{
    global $gadgetString;
    global $styleSheetFile;
    $styleSheetFile = STYLE_SHEET_MEDIA_QUERIES;
    // by default, fall back on media queries
    if (!isset($gadgetString)) {
        $gadgetString = getGadgetString($deviceData);
    }
    if ($gadgetString === "Desktop") {
        $styleSheetFile = STYLE_SHEET_DESKTOP;
    } else {
        if ($gadgetString === "Tablet") {
            $styleSheetFile = STYLE_SHEET_TABLET;
        } else {
            if ($gadgetString === "iPhone") {
                $styleSheetFile = STYLE_SHEET_APPLE_PHONE;
            } else {
                if ($gadgetString === "Android Phone" || $gadgetString === "Mobile Phone") {
                    $styleSheetFile = STYLE_SHEET_ANDROID_PHONE;
                }
            }
        }
    }
    return $styleSheetFile;
}
<!DOCTYPE html>
<html lang='en'>
<?php 
$pageTitle = basename($_SERVER['PHP_SELF'], '.php');
require_once 'Mobile-Detect/Mobile_Detect.php';
require_once '../../php/IdMyGadgetMobileDetect.php';
require_once '../all_detectors/getGadgetString.php';
require_once '../all_detectors/printStyleSheetLinkTags.php';
require_once '../all_detectors/printFooterForms.php';
$debugging = FALSE;
$allowOverridesInUrl = TRUE;
// Needed for footer forms to work
$idMyGadget = new IdMyGadgetMobileDetect($debugging, $allowOverridesInUrl);
$deviceData = $idMyGadget->getDeviceData();
$gadgetString = getGadgetString($deviceData);
?>

<head>
	<title><?php 
print $pageTitle;
?>
</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<?php 
$styleSheetFile = printStyleSheetLinkTags($deviceData);
?>
</head>

<body>
<div id="container">
<h2><?php