How would I go about checking a block of text to see if it has the '<br>' tag at either the beginning or the end? And if it does find it, how would I just strip those two occurances?
Anybody?
off the top of my head...
$pattern = array("/^<br>/", "/<br>$/"); $replace = array("//", "//"); $preg_replace($pattern,$replace,$your_string);
this of course will not work for xml style <br /> tags, but I think you can see how to do it.