ldsmike88 Posted April 7, 2006 Share Posted April 7, 2006 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 Link to comment https://forums.phpfreaks.com/topic/6843-contained-in/ Share on other sites More sharing options...
kenrbnsn Posted April 7, 2006 Share Posted April 7, 2006 You want to look at the function [a href=\"http://www.php.net/strpos\" target=\"_blank\"]strpos[/a]().Ken Link to comment https://forums.phpfreaks.com/topic/6843-contained-in/#findComment-24891 Share on other sites More sharing options...
ldsmike88 Posted April 7, 2006 Author Share Posted April 7, 2006 Worked perfect. Exactly what I needed. Thanks!Mike Link to comment https://forums.phpfreaks.com/topic/6843-contained-in/#findComment-24902 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.