Checking for a String using PHP

To detect whether a string is part of another string, use strstr. This function takes two parameters: the string to search through and the string to search for. It is not case sensitive; if you want to use a function that is case sensitive, use stristr. Lastly, there is strops, which finds the position of every first occurrence of the string you specified.

Detecting whether a string is contained in another string

This Code Returns: Passwords cannot contain the word “password”.

Share This Post

Post Comment