find in string substring php code example
Example 1: php find if string contains
if (strpos($string, 'substring') !== false) {
// do stuff
}
Example 2: php indexof
strrpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int
if (strpos($string, 'substring') !== false) {
// do stuff
}
strrpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int