<?phpfunction isMobile(){ // Wenn es HTTP_X_WAP_PROFILE gibt, muss es ein mobiles Ger?t sein if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) { Einige Dienstanbieter blockieren diese Informationen if (isset ($_SERVER ['HTTP_VIA'])) { // flase wenn nicht gefunden, sonst true return stristr($_SERVER['HTTP_VIA'], "wap") ?// Gehirnbehinderungsmethode, Beurteilung des vom Mobiltelefon gesendeten Client-Logos, Kompatibilit?t muss verbessert werden (isset ($ _Server ['http_user_agent']) {$ ClientKeywords = Array ('Nokia', 'Sony', 'Ericsson', ?MO T“, ?samsung“, ?htc“, ?sgh“, ?lg“, ?sharp“, ?sie-“, ?philip s“, ?panasonic“, ?alcatel“, ?lenovo“, ?iphone“ , ?ipod“, ?blackberry“, ?meizu“, ?android“, ?netfront“, ?symbian“, ?ucweb“, ?windowsce“, ?palm“, ?operamini“, ?operamobi“, ?openwave“, ? nexusone', ' cldc', 'midp', 'wap', 'mobile' ); // Schlüsselw?rter für mobile Browser aus HTTP_USER_AGENT finden if (preg_match("/(" . implode('|', $clientkeyword s) . ") / i", strtolower($_SERVER['HTTP_USER_AGENT']))) { ? ? ? ? ? ? ? return true;// Protokollmethode, da sie m?glicherweise ungenau ist, überlassen Sie sie der endgültigen Entscheidung if (isset ($_SERVER['HTTP_ACCEPT'])) { // Wenn es nur WML und kein HTML unterstützt, muss es ein mobiles Ger?t sein // Wenn es WML und HTML unterstützt, aber WML ein mobiles Ger?t vor HTML ist if ((strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false) && (strpos($_SERVER[' HTTP_ACCEPT'], 'text /html') === false ||. (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/ html')))) { return true; // Das Terminal ist ein PC, springe zur PC-URL echo '<script>location.href=""</script>'; /pc-Zugriffsadresse if(isMobile()) { // Das Terminal ist ein mobiles Terminal, springe zur URL des mobilen Terminals echo '<script>location.href=""</script>';