$result = strpos("haystack", "needle"); if ($result != false) { // text found }
if (strpos($haystack,$needle) !== false) { echo "$haystack contains $needle"; }
$haystack = 'This is my haystack that we shall check' $has_A = strpos($haystack, 'A') !== false; $has_a = strpos($haystack, 'a') !== false;