Hello, this is my very first post :-D
I'm a web developer from Japan.
Recently I start to creating a website for smartphone.
I think this User Agent detection (PHP) is correct.
Are they correct? Please help me out.
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
$ua = $_SERVER['HTTP_USER_AGENT'];
# smartphone
if
(
(ereg("iPhone", $ua))
|| (ereg("Android", $ua))
|| (ereg("Windows Phone", $ua))
|| (ereg("BlackBerry", $ua))
)
{
$flg = 's';
}
# mobile
elseif(
(ereg("DoCoMo", $ua))
|| (ereg("SoftBank", $ua))
|| (ereg("Vodafone", $ua))
|| (ereg("J-PHONE", $ua))
|| (ereg("UP.Browser", $ua))
|| (ereg("KDDI", $ua))
|| (ereg("WILLCOM", $ua))
|| (ereg("DDIPOCKET", $ua))
|| (ereg("PDXGW", $ua))
|| (ereg("Googlebot-Mobile", $ua))
|| (ereg("Y!J", $ua))
|| (ereg("LD_mobile_bot", $ua))
|| (ereg("moba-crawler", $ua))
|| (ereg("RFCrawler-Mobile", $ua))
|| (ereg("froute.jp", $ua))
|| (ereg("ichiro", $ua))
)
{
$flg = 'm';
}
# PC
else
{
$flg = 'p';
}
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Thank you for your interest :-D