In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (J Smith) wrote:
> > I need a search function (if statement) that performs a search on a string
> > and if the string contains something like "aol.com", performs another
> > function. Can anyone help me? Thanks.
> >
> > Joseph
> >
>
> Try rese
aracter by character, C-style. :-)
> -Original Message-
> From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] RE: string search
>
> Couldn't he just do something like
>
> if (strstr($text, "aol.com")) {
>MyFunction();
&g
PROTECTED]>
To: php <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 10:59 AM
Subject: RE: [PHP] RE: string search
> read the docs for ereg... i hardly use it, so i dont know
> for certain if it will match. (althouth the use of "^" at
> beginning *and* end suggests that
-Original Message-
> From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 11:49 AM
> To: PHP (E-mail)
> Subject: [PHP] RE: string search
>
>
> Will this work?
>
> $string = "http://www.aol.com/";;
>
> if (ereg ("^ao
Will this work?
$string = "http://www.aol.com/";;
if (ereg ("^aol.com^", $string) {
}
else {
}
> I need a search function (if statement) that performs a search on a string
> and if the string contains something like "aol.com", performs another
> function. Can anyone help me? Thanks.
have a look at ereg() (regular expression match) functions in manual.
they'll do exactly what you want.
Steve
"Joseph Bannon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need a search function (if statement) that performs a search on a string
> and if t
Joseph Bannon wrote:
> I need a search function (if statement) that performs a search on a string
> and if the string contains something like "aol.com", performs another
> function. Can anyone help me? Thanks.
>
> Joseph
>
Try researching regular expressions. In PHP, look at the preg and ereg
7 matches
Mail list logo