You might check your usage of the strstr() function, it may be a simple typo or something. The following works fine for me.
<?php
$s = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12";
echo ($found=strstr($s,"Firefox")) ? $found : "(not found)";
echo "Firefox position: ".strpos($s,"Firefox");
echo "Firefox removed..";
$s = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070508 /1.5.0.12";
echo ($found=strstr($s,"Firefox")) ? $found : "(not found)";
echo "Firefox position: ".strpos($s,"Firefox");
?>
preg_match() is always an option if you need more complicated parsing.
Edit: The above was just a knock-up test demo - not my suggestion for code to check browser type :)
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847