Ventrix’s Code Folds

php string contains

by ventrix on Feb.12, 2009, under Uncategorized

$text = “this is a happy cow”;
$a = “happy”;

if (strlen(strstr($text,$a))>0) {
echo “contained”;
} else {
echo “not contained”;
}

No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...