Re: Re: HTTP_USER_AGENT and preg_match
| From: | Teodor Cimpoesu | Date: | Tue, 23 Jan 2001 10:06:54 +0000 |
| Subject: | Re: Re: HTTP_USER_AGENT and preg_match | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-36159@lists.php.net to get a copy of this message | ||
Hi John!
On Tue, 23 Jan 2001, John Hinsley wrote:
> Got it in the end. It should be:
>
> <snip>
>
>
> if ((preg_match("/Mozilla/i", "$agent")) &&
> (preg_match("/Gecko/i",
> "$agent"))) {
> $result = "You are using Netscape 6 or a later version of Mozilla.";
>
> <snip>
>
> But the thought occurs that there must be a site out there somewhere
> which lists the HTTP_USER_AGENT tags for *all* browsers?
I've got a nice browsecap.ini file from php4win.de.
You can then simply use get_browser() [ listed under Miscellaneous functions]
-- teodor