Recently I get an exception while I try to implement a special template engine.
Mine problem with DOMDocument load is in fact that I use some place holders in href and it will be replaced after with real values. I want to store that template and to use it each time when I need it, here is code sample
$this->dom = new DOMDocument;
$load_html = $this->dom->loadHTML($html);
And nesty part of HTML looks like
<a href="@_@web_site_address@_@">Visit our web site</a>
and exception is
Fatal error: DOMDocument::loadXML() [<a href='domdocument.loadxml'>domdocument.loadxml</a>]: EntityRef: expecting ';' in Entity
I was try to find a some way to skip that check but couldn't find anything.
@_@as a placeholder? that might be setting it off.@_@web_site_address@_@should force an error, there must be wrong something else. You should look out for an ampersand, I'm pretty sure that you'll find the error there.