You can use the PHP strpos() function to check whether a string contains a specific word or not. The strpos() function returns the position of the first occurrence of a substring in a string. If the substring is not found it returns false . Also note that string positions start at 0, and not 1.
Read moreIs Strpos case-sensitive PHP?
strpos() Function: This function helps us to find the position of the first occurrence of a string in another string. This returns an integer value of the position of the first occurrence of the string. This function is case-sensitive , which means that it treats upper-case and lower-case characters differently.
Read moreIs Stripos case-sensitive?
stripos() is not case-sensitive .
Read moreWhat is case-insensitive in PHP?
Summary. PHP is partially case-sensitive. PHP constructs, function names, class names are case-insensitive, whereas variables are case-sensitive.
Read moreIs PHP str replace case-sensitive?
PHP str_replace is case-sensitive . If you need to perform a case-insensitive search, try str_ireplace() function. If the variable specified by the third argument is an array, the function will check every array element and will return an array.
Read moreHow do you make a string case-insensitive in PHP?
PHP strcasecmp() Function
Read moreIs str contains case-sensitive PHP?
strripos() – Finds the position of the last occurrence of a string inside another string (case-insensitive ) strpos() – Finds the position of the first occurrence of a string inside another string (case-sensitive)
Read more