<?php
$str = ‘nilpointer.net’;
$keyword = ‘pointer’;
if (str_contains($str, $keyword)) {
echo ‘The string contains “‘.$keyword.'”‘;
} else {
echo ‘The string does not contains “‘.$keyword.'”‘;
}
?>
<?php
$str = ‘nilpointer.net’;
$keyword = ‘pointer’;
if (str_contains($str, $keyword)) {
echo ‘The string contains “‘.$keyword.'”‘;
} else {
echo ‘The string does not contains “‘.$keyword.'”‘;
}
?>