possible categories 19249 n picollo maricopa 85138

This is a regular not-bold sentence; incorrect coding shown on next line

<b>Test line with no end tag </b> test line has start tag only <p>

and this sentence has start and end 'p' tags and should *NOT* be bold but it still is due to not closing prior bold tag.

I am closing the bold tag and explaining as well as displaying the tag with a < code> coded, faux closing tag by using ampersand l, t, semi-colon in front of the code element. </b> </b>

This is still should be correct (not-bold), because the end tag is now set just befor this sentence. Notice you can use a space in place of &, l, t, ; if your copy paste gives you a hard time with ASCII.

---- $str = '

This is some text and here is a bold text then the post stop here....

'; $tidy = new Tidy(); $clean = $tidy->repairString($str, array( 'output-xml' => true, 'input-xml' => true )); echo $clean; ---- */function closetags($html) { #put all opened tags into an array preg_match_all('#<([a-z]+)(?: .*)?(?#iU', $html, $result); $openedtags = $result[1]; #put all closed tags into an array preg_match_all('##iU', $html, $result); $closedtags = $result[1]; $len_opened = count($openedtags); # all tags are closed if (count($closedtags) == $len_opened) { return $html; } $openedtags = array_reverse($openedtags); # close tags for ($i=0; $i < $len_opened; $i++) { if (!in_array($openedtags[$i], $closedtags)){ $html .= ''; } else { unset($closedtags[array_search($openedtags[$i], $closedtags)]); } } return $html;} ?>