Return to Snippet

Revision: 30039
at August 6, 2010 09:26 by benhomie


Initial Code
<?php
	$iphone = strpos($_SERVER['HTTP_USER_AGENT'],”iPhone”);
	$ipod = strpos($_SERVER['HTTP_USER_AGENT'],”iPod”);
	$ipad = strpos($_SERVER['HTTP_USER_AGENT'],”iPad”);
	$android = strpos($_SERVER['HTTP_USER_AGENT'],”Android”);
	$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],”webOS”);
	if($iphone || $ipod || $ipad || $android || $palmpre) 
	{
		//do something here
	}
?>

Initial URL

                                

Initial Description

                                

Initial Title
Detect Mobile Devices (useragent)

Initial Tags

                                

Initial Language
PHP