Answer the question
In order to leave comments, you need to log in
Why does DIDOM library remove php code?
Greetings!
There was a problem with the php library for DIDOM parsing.
I am loading HTML from a local php file like this:
$document->loadHtml('front.php', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$document->format()->html(LIBXML_NOEMPTYTAG);
, then this php code will be deleted entirely. <div>
<h1>Text</h1>
</div>
<?php
echo "test";
in this file, and that is why after displaying the contents of this file by the html () method, there will be no php code at all:<div>
<h1>Text</h1>
</div>
, then there will be no problems and everything will be displayed as it should. How to cancel such behavior? So that php code is not cut out despite the fact that the closing tag
is not affixed.
Answer the question
In order to leave comments, you need to log in
It's easier to add ("close" the tag) manually.
Changing behavior is unlikely.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question