function detectAppleMobile($query = '') { $container = $_SERVER['HTTP_USER_AGENT']; //print_r($container); //this prints out the user agent array. uncomment to see it shown on page. $useragents = array("iPhone", "iPod", "Aspen"); //print_r($container); //this prints out the user agent array // Add whatever user agents you want here if you want to make this show on a Blackberry or something. No guarantees it'll look pretty, though! $useragents = array("iPhone", "iPod", "Aspen", "n800", "n810",); $this->applemobile = false; foreach ($useragents as $useragent) { if (eregi($useragent, $container)) { $this->applemobile = true; } } }