<head> <title>Hello This Is So Hard! Not!</title> </head> <p>hello</p>
$string = ' lolz <p>this is fun</p> lol';$patterns[0] = '/<p>(.*?)</p>/';$replacements[0] = ' ';echo preg_replace($patterns, $replacements, $string);
$string = ' lolz <p>this is fun</p> lol';$string = strip_tags($string);// If you want to allow certain tags use (in this case, <p> and <a>):$string = strip_tags($string, '<p><a>');