RE: [PHP] RE: string search

From: Date: Mon, 16 Jul 2001 17:18:55 +0000
Subject: RE: [PHP] RE: string search
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58088@lists.php.net to get a copy of this message
hehe... that's what regular expressions are for. they're extrememly powerful... but that doesnt mean that you should only use them for extremely complicated situations. they work great everywhere... if you dont like "overdoing it", you might as well loop thru the string character by character, C-style. :-) > -----Original Message----- > From: Sheridan Saint-Michel [mailto:webmaster@foxjet.com] > Subject: Re: [PHP] RE: string search > > Couldn't he just do something like > > if (strstr($text, "aol.com")) { > MyFunction(); > } else { > echo "Not Found"; > } > > It just seems like using ereg for this is like killing a fly with a > sledgehammer > > Sheridan

« previous php.general (#58088) next »