Jump to content


Photo

Contained in


  • Please log in to reply
2 replies to this topic

#1 ldsmike88

ldsmike88
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts
  • LocationFlorida

Posted 07 April 2006 - 09:30 PM

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:


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

How do I do this?

Thanks!

Mike

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 07 April 2006 - 09:34 PM

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

Ken

#3 ldsmike88

ldsmike88
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts
  • LocationFlorida

Posted 07 April 2006 - 10:35 PM

Worked perfect. Exactly what I needed. Thanks!

Mike




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users