How to check if a string contains a character or word in PHP?
An example is given below:
BY Best Interview Question ON 05 May 2020
Example
$mainString = "I am Bestinterviewquestion.com";
$searchedString = "am";
if( strpos( $mainString, $searchedString ) !== false) {
echo "\"am\" exists in the main string";
}