Re: [PHP] problem with if and exact match

2011-03-15 Thread FeIn
, March 15, 2011 1:10 AM To: Jack Subject: Re: [PHP] 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

RE: [PHP] problem with if and exact match

2011-03-15 Thread Steve Staples
On Tue, 2011-03-15 at 01:20 -0400, Jack wrote: Thanks everyone... great examples...works ( both methods ) Thanks! Jack -Original Message- From: Alexis Antonakis [mailto:ad...@antonakis.co.uk] Sent: Tuesday, March 15, 2011 1:10 AM To: Jack Subject: Re: [PHP] problem

Re: [PHP] problem with if and exact match

2011-03-15 Thread Shawn McKenzie
On 03/15/2011 07:30 AM, Steve Staples wrote: Wouldn't this be better to use, as it is meant to search for the string inside the string? (use use regex) if(stristr($name, 'Jackson')) { echo String is in String; } else { echo Failed; }

[PHP] problem with if and exact match

2011-03-14 Thread Jack
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

Re: [PHP] problem with if and exact match

2011-03-14 Thread Admin
Try If(preg_match(/Jackson/i, $name)) {echo 'match'; }else{ echo 'fail'; } Richard Buskirk Sent from my iPhone On Mar 15, 2011, at 1:02 AM, Jack jacklistm...@gmail.com wrote: I want to be able to match if a string is contained within the string I am evaluating. I know that if ( $name

Re: [PHP] problem with if and exact match

2011-03-14 Thread Simon J Welsh
On 15/03/2011, at 6:02 PM, 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

RE: [PHP] problem with if and exact match

2011-03-14 Thread Jack
Thanks everyone... great examples...works ( both methods ) Thanks! Jack -Original Message- From: Alexis Antonakis [mailto:ad...@antonakis.co.uk] Sent: Tuesday, March 15, 2011 1:10 AM To: Jack Subject: Re: [PHP] problem with if and exact match http://php.net/manual/en