Answers for "if string include in php"

PHP
3

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 string contains

$mystring = 'abc';
$findme   = 'a';
$pos = strpos($mystring, $findme);
Posted by: Guest on May-20-2020

Browse Popular Code Answers by Language