Often, we see two approaches for this. One option is to use the strpos PHP function. The following example shows how this is used:
<?php
$pos = strpos($haystack,$needle);
$pos = strpos($haystack,$needle);
if($pos === false) {
// string needle NOT found in haystack
}
else {
// string needle found in haystack
}
?>
// string needle NOT found in haystack
}
else {
// string needle found in haystack
}
?>

0 comments:
Post a Comment