Answers for "php string has string"

PHP
2

php string contains

$string = 'The lazy fox jumped over the fence';

if (str_contains($string, 'lazy')) {
    echo "The string 'lazy' was found in the string\n";
}
Posted by: Guest on July-23-2021
6

php find if string contains

if (strpos($string, 'substring') !== false) {
	// do stuff 
}
Posted by: Guest on August-25-2020
1

php string contains

<?php
$string = 'The lazy fox jumped over the fence';

if (str_contains($string, 'lazy')) {
    echo "The string 'lazy' was found in the string\n";
}

if (str_contains($string, 'Lazy')) {
    echo 'The string "Lazy" was found in the string';
} else {
    echo '"Lazy" was not found because the case does not match';
}

?>
Posted by: Guest on April-06-2021
2

php string contains

str_contains(string $haystack , string $needle);
Posted by: Guest on June-02-2021

Browse Popular Code Answers by Language