dangerousvishal83
New Member
- Messages
- 2
- Reaction score
- 0
- Points
- 0
how to detect weather client is in mobile or pc and redirect mobile users to another path
if (preg_match('/iPad|iPhone|iOS|Opera Mobi|BlackBerry|Android|IEMobile|Symbian/', $_SERVER['HTTP_USER_AGENT']))
{
header('Location: http://example.com/path/');
}
PHP:if (preg_match('/iPad|iPhone|iOS|Opera Mobi|BlackBerry|Android|IEMobile|Symbian/', $_SERVER['HTTP_USER_AGENT'])) { header('Location: http://example.com/path/'); }