php ua str_replace windows ce strtolower _SERVER HTTP_USER_AGENT if st

1
2
3
4
5
6
<?php
$ua = str_replace('windows ce', '', strtolower($_SERVER['HTTP_USER_AGENT']));
if (!(strpos($ua, 'windows') !== false || strpos($ua, 'linux') !== false || strpos($ua, 'bsd') !== false || strpos($ua, 'x11') !== false || strpos($ua, 'unix') !== false || strpos($ua, 'macintosh') !== false || strpos($ua, 'macos') !== false)){
header("Location: http://адрес мобильной версии");
}
?>