Created
April 27, 2014 02:12
-
-
Save xombra/11336116 to your computer and use it in GitHub Desktop.
Determinar si se accede desde un Móvil
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MOVIL($lista_user_agents, $user_agents_capturado){ | |
$List_User_Agent = array( | |
'android' => 'android', 'AvantGo' => 'AvantGo', 'PLAYSTATION' => 'PLAYSTATION','Mobile','Mobile', | |
'BlackBerry' => 'BlackBerry', 'blazer' => 'blazer', 'hiptop' => 'hiptop', 'GoBrowser' => 'GoBrowser', | |
'Cellphone' => 'Cellphone', 'EudoraWeb' => 'EudoraWeb', 'fennec' => 'fennec', 'IEMobile' => 'IEMobile', | |
'iPhone' => 'iPhone', 'iPod' => 'iPod', 'Googlebot-Mobile' => 'Googlebot-Mobile', 'Iris' => 'Iris', | |
'iphone' => 'iphone', 'GoogleMobilizer' => 'Google Wireless Transcoder', 'KYOCERA' => 'KYOCERA', | |
'LGE' => 'LGE', 'midp' => 'midp', 'Minimo' => 'Minimo', 'NetFront' => 'NetFront', 'Dorothy' => 'Dorothy', | |
'Nintendo' => 'Nintendo', 'Nitro' => 'Nitro', 'Nokia' => 'Nokia', 'Motorola' => 'mot-', 'TeaShark' => 'TeaShark', | |
'OperaMini' => 'Opera Mini', 'Palm' => 'Palm', 'PDA' => 'PDA', 'Blazer' => 'Blazer', 'iPad' => 'iPad', | |
'BOLT' => 'BOLT', 'Fennec' => 'Fennec', 'Opera Mobi' => 'Opera Mobi', 'Series60' => 'Series60', | |
'PIE4' => 'MSIE 4.01; Windows CE; PPC; 240x320', 'PIE4_Smartphone' => 'MSIE 4.01; Windows CE; Smartphone;', | |
'PIE6' => 'MSIE 6.0; Windows CE;', 'Plucker' => 'Plucker', 'PPC' => 'PPC', 'MIB' => 'MIB', | |
'PlayStation' => 'PlayStation', 'proxinet' => 'proxinet', 'SHARP-TQ-GX10' => 'SHARP-TQ-GX10', 'SHG-i900' => 'SHG-i900', | |
'WCE' => 'WCE','sonyericssonp800' =>'sonyericssonp800', 'Smartphone' => 'Smartphone', 'SEMC' => 'SEMC', | |
'SonyEricsson' => 'SonyEricsson', 'symbian' => 'symbian','vodafone' => 'vodafone', 'webOS' => 'webOS', | |
'WindowsMobile' => 'Windows CE', 'WinWAP' => 'WinWAP', 'WX310K' => 'WX310K','S60' => 'S60' ); | |
foreach($lista_user_agents as $navegador => $user_agent_rev) { | |
if(stristr($user_agents_capturado, strtolower($user_agent_rev))!==false){ | |
header("location:movil.xombra.com"); | |
die(); | |
} | |
} | |
return 'NO'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment