programming-examples/php/String/PHP script to check if a string contains a specific string.php
2019-11-15 12:59:38 +01:00

11 lines
217 B
PHP

<?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.';
}
?>