
May 16th, 2000, 10:34 PM
|
|
Contributing User
|
|
Join Date: Mar 2000
Location: Boston, MA
Posts: 54
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
Hello..
to find an specific block of text or word within the value of a variable you can try this
let's say we have the following:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> $browser = getenv("HTTP_USER_AGENT"); [/code]
you can use preg_match() func. to search for "MSIE" within $browser, like this:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> preg_match("/MSIE/i", "$browser"); [/code]
the "i" tells the script to match any instances, uppercase and lowercase etc...
(PHP Essentials book)
i hope this is useful for yaaa
Mike
Linux,php3,MySQL newbie
ohh and by the way maybe you know the answer to the question a posted (below yours)
thank-Q
|