Jump to content

Archived

This topic is now archived and is closed to further replies.

ldsmike88

Contained in

Recommended Posts

I am trying to find out if "Windows NT 5.1" is contained in "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" or similar text. For example:


[code]
$userAgent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)';
If($userAgent CONTAINS 'Windows NT 5.1'){
    $os = 'Windows XP';
}
[/code]

How do I do this?

Thanks!

Mike

Share this post


Link to post
Share on other sites
You want to look at the function [a href=\"http://www.php.net/strpos\" target=\"_blank\"]strpos[/a]().

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.