Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use <- with strip_tags? I've tried converting the symbols before and after with no luck
    primarykey
    data
    text
    <p>Okay... I know &lt;- cant be excluded from strip_tags using allowable tags per say but im trying to use a work around. The work around works fine on character sets that wouldn't be valid HTML to begin with, such as &lt;&lt; or &lt;~ however when i use the code below to convert the &lt;- or -> to digits before strip_tags is processed and then back from digits to the &lt;- and -> after. But whenever those symbols show up all HTML from there on is removed, that or not processed. I understand i cant have it left alone through allowable tags which is why i convert it before the strip_Tags and back after... but its almost as if strip_Tags still removes it even though its converted back after the line where strip_tags is, since its removing &lt;- and taking everything to the right of it.... Any ideas or other ways to try? I've also tried defining &lt;- as <code>&amp;lt;—</code> and tried replacing it with other symbols as well, such as #- but no matter what i have the same outcome.</p> <p>I should also mention the &lt;- and -> arent used together, they are used to point to things in text. Like internt &lt;- is misspelled there.</p> <pre><code>`&lt;?php $data = file_get_contents("test.html"); $data = str_replace("&lt;-", "999", $data); $data = str_replace("-&gt;", "998", $data); $data = strip_tags($data, ''); $data = str_replace("999", "&lt;-", $data); $data = str_replace("998", "-&gt;", $data); echo $data; ?&gt;` </code></pre> <p>I was gathering sample data and realize if i remove a good chunk of the sample HTML everything works fine, turns out if i strip actual HTML comments such as <code>&lt;!-- Header //--&gt;</code> on my own the conversion goes fine, so im going to look for a regex match to remove the HTML comments before the conversion and the striptags.</p> <p><strong>Update</strong></p> <p>I used the following code below to remove the HTML comments first, which results in success. Thanks for your help.</p> <pre><code>`$data = preg_replace('/&lt;!--(.*)--&gt;/', '', $data);` </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload