Write a PHP script to check whether a string contains a specific string?
Sample string : 'The quick brown fox jumps over the lazy dog.'Check whether the said string contains the string 'jumps'
<?php $str1 = 'The quick brown fox jumps over the lazy dog.'; if (strpos($str1,'jumps') !== false) { echo 'The specific word is present.'; } else { echo 'The specific word is not present.'; } ?>
Sample Output:
The specific word is present.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer