note 15496 added to function.strstr
| From: | corky6921 at NOSPAMPLEASE-yahoo dot com | Date: | Thu, 13 Sep 2001 23:19:07 +0000 |
| Subject: | note 15496 added to function.strstr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17999@lists.php.net to get a copy of this message | ||
This function can be very useful. For instance:
I had to test for Windows because I was setting a file to download to the client computer from a
UNIX server, and the carriage returns are different. Here is a tiny little statement that works
(tested on Win/IE, Win/Netscape, Solaris/IE and Solaris/Netscape.)
if(strstr(getenv('HTTP_USER_AGENT'), 'Win')) {
$os = "Windows";
}
else {
$os = "Not Windows";
};
More like this @ the get_browser function page (including how to test for IE vs. Netscape, etc.)
http://www.php.net/manual/en/function.strstr.php