The best way i can think of is find the position of each HTML tag in turn and store it and its position by character in an Array.
$pos = strpos($FULLHTML, $TAG);
$tags[1][1] = $TAG;
$tags[1][2] = $pos;
then remove that tag
and start again
you then use your wordwrap function
Then finally re-insert tags
Thanks
Option