Hi guys here I am going to share how to find a text inside a particular given string by using PHP

here is the code

$string_t0_search = “PHP”;
$paragraph = “I love writing PHP code.”;

if(strstr($paragraph,$string_to_search)) {
echo “found it.”;
} else {
echo “not found.”;
}

strstr() is php function used to  seasrch for the first occurrence of a string inside another string.

Related Posts