1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Rep Power
    Hi, i have a question here.

    If i store a long string, how can i check if there are a word which i want to match.....
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Boston, MA
    Rep Power
    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
    Linux,php3,MySQL newbie

    ohh and by the way maybe you know the answer to the question a posted (below yours)

Similar Threads

  1. Need to substitute pattern match for string
    By VytamynJ in forum Perl Programming
    Replies: 3
    Last Post: February 10th, 2004, 09:46 AM
  2. array explode ( string separator, string string [, int limit])
    By beemee_freeserv in forum HTML Programming
    Replies: 4
    Last Post: February 5th, 2004, 10:56 AM
  3. mgetty+sendfax on RH9
    By ayrin in forum Linux Help
    Replies: 0
    Last Post: January 31st, 2004, 02:11 AM
  4. Whois Servers and nomatch value
    By computer in forum Dev Shed Lounge
    Replies: 7
    Last Post: November 7th, 2003, 07:06 AM

IMN logo majestic logo threadwatch logo seochat tools logo