check is a value is on an string php code example
Example 1: php find if string contains
if (strpos($string, 'substring') !== false) {
// do stuff
}
Example 2: check if string contains substring php 8
str_contains('STRING', 'SUB_STRING');
if (strpos($string, 'substring') !== false) {
// do stuff
}
str_contains('STRING', 'SUB_STRING');