php variable contains code example
Example 1: php string contains
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
Example 2: string contains php
$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
$a = 'How are you?';
if (strpos($a, 'are') !== false) {
echo 'true';
}