
PHP
PHP String Contains a Specific Word or Substring
PHP string contains : In this tutorial we will see how to check that a string contains a specific character or substring. Introduction A string is a sequence of characters, which can be a variable or a literal constant in PHP or as in most programming languages. A specific part of a string is called a substring. In PHP, there are several ways to check if a character, word or substring is included or not in another string. Here are the different methods we will discuss in this tutorial : The strpos() function to check if the string contains…