in reply to read a file and insert closing tags if not present

I second GrandFather's recommendation to have a closer look at HTML Tidy. As documented here,

  • Missing or mismatched end tags are detected and corrected
  • End tags in the wrong order are corrected

HTH,

planetscape
  • Comment on Re: read a file and insert closing tags if not present