Going Nuts with Ereg/Eregi
| From: | Patrick Teague | Date: | Tue, 02 Jul 2002 10:26:45 +0000 |
| Subject: | Going Nuts with Ereg/Eregi | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104889@lists.php.net to get a copy of this message | ||
Ack!
Ok, Ereg/Eregi returns the first matching string. How do I find any other
matching strings? Or is there a better way of doing this?
$eregi_str = "(\; |\()Win[ \.a-z0-9]*(\)|\;)";
if( eregi( $eregi_str, $browser_string, $arrstring ) )
{
$browser_os = $arrstring[0];
}
This works fine except on some browsers which like to return Windows
multiple times such as this -
"Mozilla/5.0 (Windows; U; Win98; en-US;........"
Knowing that it's Windows doesn't help, I need to know it's Win98, etc.
Thanks for any help :)
Patrick