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...
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”;
}
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!
A few highly recommended friends...
All entries, chronologically...