我需要匹配 2 个字符串并在匹配字符串后添加换行符


i need to match 2 string and adding line break after match string

>例如,我需要匹配 2 个字符串并在匹配字符串后添加换行符

$string1="<p>he adventures of adolescence had taught Piet Barol that he</p>";
$matching_with_string="he adventures
of adolescence had
taught Piet Barol 
that he";

我需要字符串 1 输出将与字符串相同

$matching_with_string

有人可以帮我吗!

不确定这是否是您的要求:

if(strstr($string1,$matching_with_string)){
//your code
}