1 min read

[Solution] Check if a string contains a specific word?

It’s very easy like this :

It’s very easy like this :

$var = 'Hello my name is Alex?';

if (strpos($var, 'name') !== false) {
    echo 'true';
}
PHP Dec 16, 2019