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

    Join Date
    May 2000
    Posts
    65
    Rep Power
    15
    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
    Location
    Boston, MA
    Posts
    54
    Rep Power
    15
    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

Similar Threads

  1. Need to substitute pattern match for string
    By VytamynJ in forum Perl Programming
    Replies: 3
    Last Post: February 10th, 2004, 10: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, 11:56 AM
  3. mgetty+sendfax on RH9
    By ayrin in forum Linux Help
    Replies: 0
    Last Post: January 31st, 2004, 03:11 AM
  4. Whois Servers and nomatch value
    By computer in forum Dev Shed Lounge
    Replies: 7
    Last Post: November 7th, 2003, 08:06 AM

IMN logo majestic logo threadwatch logo seochat tools logo