PDA

View Full Version : If $string contains (value) then... ?


sweenster
05-22-2005, 10:53 PM
I have the following chunk of ASP code to detect the users browser:


strUA = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(strUA, "MSIE") Then
brdata = "ie"
Else
If InStr(strUA, "Firefox") Then
brdata = "ff"
Else
brdata = "ot"
vers = 0
End If
End If


I'm looking to convert this to work in PHP but I cant seem to find any simple command like the one above that asks "If $string contains 'MSIE' then..."

Any ideas?

NancyJ
05-22-2005, 11:22 PM
if(stristr($strUA, 'MSIE')){