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" <JackListMail@xxxxxxxxx> 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