★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum5/HTML/001159.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  PHP
  Match a string from a "string"

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Match a string from a "string"
mfkoo
Member
posted May 16, 2000 09:09 PM     Click Here to See the Profile for mfkoo   Click Here to Email mfkoo     Edit/Delete Message Reply w/Quote
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.....

eduany
Member
posted May 16, 2000 09:34 PM     Click Here to See the Profile for eduany   Click Here to Email eduany     Edit/Delete Message Reply w/Quote
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:

code:
 $browser = getenv("HTTP_USER_AGENT"); 


you can use preg_match() func. to search for "MSIE" within $browser, like this:
code:
 preg_match("/MSIE/i", "$browser"); 


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

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.