I am after a bit of advice.
We have a web site that uses a PHP preg_match script to determine if they are on iphone, blackberry or android (yes I know there are others). And if they are, it redirects them straight to the mobile version.
However, we want to give them the option to "go to Normal site" should they want to, since many phones now show the normal site just as well - and often it has more features anyway.
Code: Select all
if ((preg_match("/(iPhone|BlackBerry|Android)/", $_SERVER["HTTP_USER_AGENT"]) || ($cookiedevice == NULL))
{ ... }But this won't work, because it's an "||" or statement. So what's the best way to do this?