lol @ g00g, did u notice they happened to 'forget' iphone in that class, not much biased.. really..Ready made code for you: http://code.google.com/p/php-mobile-detect/
if they are static pages, u have two options, use the web server to redirect (best way) or add a javascript to your pages to detect and redirect (not so good and not seo friendly). check with your host what kind of server they are running?I am using static pages. so i just want www.example.com to detect if i am using a mobile or not... if so redirect to m.example.com if not then stay at the www.
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "http://m.site.com";
}
//-->
</script>
lol @ g00g, did u notice they happened to 'forget' iphone in that class, not much biased.. really..![]()
protected $devices = array(
"android" => "android",
"blackberry" => "blackberry",
"iphone" => "(iphone|ipod)",
"opera" => "opera mini",
"palm" => "(avantgo|blazer|elaine|hiptop|palm|plucker|xiino)",
"windows" => "windows ce; (iemobile|ppc|smartphone)",
"generic" => "(kindle|mobile|mmp|midp|o2|pda|pocket|psp|symbian|smartphone|treo|up.browser|up.link|vodafone|wap)"
);