When I try to load an HTML file as XML using simplexml_load_string I get many errors and warnings regarding the HTML and it fails, it there a way to properly load an html file using SimpleXML?
This HTML file may have unneeded spaces and maybe some other errors that I would like SimpleXML to ignore.
I would suggest using PHP Simple HTML DOM. I’ve used it myself for anything from page scraping to manipulating HTML template files and its very simple and quite powerful and should suit your needs just fine.
Here’s a few examples from their docs that show the kind of things you can do: