PHP String Contains String – String Function

 
    <?
$text = 'PHP rules!';if (ereg('PHP', $text)) {
  echo( '$text contains the string "PHP".' );
} else {
  echo( '$text does not contain the string "PHP".' );
}
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.