Re: problem with if and exact match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



strpos example is much faster though ....

On Tue, Mar 15, 2011 at 7:20 AM, Jack <JackListMail@xxxxxxxxx> wrote:

> Thanks everyone... great examples...works.... ( both methods )
>
> Thanks!
> Jack
>
> > -----Original Message-----
> > From: Alexis Antonakis [mailto:admin@xxxxxxxxxxxxxxx]
> > Sent: Tuesday, March 15, 2011 1:10 AM
> > To: Jack
> > Subject: Re:  problem with if and exact match
> >
> > http://php.net/manual/en/function.preg-match.php
> >
> > On 14/03/11 23:02, Jack wrote:
> > > I want to be able to match if a string is contained within the string
> > > I am evaluating.
> > >
> > >
> > >
> > > I know that if ( $name == "xxjacksonxx"); based on the below would be
> > true.
> > >
> > > But I want to be able to say if "jackson"  is contained within $name
> > > that it's a match.
> > >
> > >
> > >
> > > I tried the below without success..
> > >
> > > Not getting the operand properly..
> > >
> > >
> > >
> > > <?
> > >
> > >
> > >
> > > $name = "xxjacksonxx";
> > >
> > >
> > >
> > > if ( preg_match($name, "jackson")) {
> > >
> > >     print "true";
> > >
> > >
> > >
> > > } else {
> > >
> > >
> > >
> > >     print "false";
> > >
> > > }
> > >
> > >
> > >
> > > ?>
> > >
> > >
> > >
> > > Thanks!
> > >
> > > Jack
> > >
> > >
> > >
> > >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux