I'm trying to identify a visitor's phone type based on their UserAgent string. I can't find the error in my code, however.
<?php
//create an array to be filled with phone type
$arr = phones();
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
$nokia = strpos($_SERVER['HTTP_USER_AGENT'],"Nokia");
if ($iphone || $android || $palmpre || $ipod || $berry || $nokia == true)
{
echo "Specially for you as $iphone owner!";
}
?>