Redirect Mobile Devices with PHP

<?php
$android = strpos($_SERVER['HTTP_USER_AGENT'],'Android'); $ipod = strpos($_SERVER['HTTP_USER_AGENT'],'iPod'); $iphone = strpos($_SERVER['HTTP_USER_AGENT'],'iPhone'); $palmpre = strpos($_SERVER['HTTP_USER_AGENT'],'webOS'); $berry = strpos($_SERVER['HTTP_USER_AGENT'],'BlackBerry');

if ($iphone || $android || $palmpre || $ipod || $berry == true) { header('Location: http://mobile.web.com/'); } ?>