Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I use PHP to save only the visible elements of the output as a new file?
    primarykey
    data
    text
    <p>I've got a php file that takes an xml file (generated by an outside source) and reformats it with CSS &amp; HTML. A number of the XML tags are things I don't want to see in the final version, so I have them hidden. The end result is something like this:</p> <pre><code>&lt;html&gt; &lt;div style="display: none"&gt; content i don't want to see &lt;/div&gt; content I do want to see. &lt;/html&gt; </code></pre> <p>Is there a way I can take the resulting html file as it's displayed in the browser window, </p> <pre><code>content I do want to see. </code></pre> <p>…and save that as a text file? I want it to ignore all the hidden <code>&lt;div&gt;</code> tags and only save what can otherwise be selected and copied by the user.</p> <p>I've looked around for an answer to this but I'm not even really sure what I'm looking for or how to search it.</p> <p>I've also tried this:</p> <pre><code>ob_start(); file_put_contents('filename.htm', ob_get_contents()); ob_end_flush(); </code></pre> <p>… but that's doesn't solve it. I have a number of tags in the outputted test (<code>&amp;gt;</code> etc) that need to be saves as they are displayed, and <code>ob_get_contents()</code> takes the page's source code, not the displayed version.</p> <p>This matters because the outputted page is also PHP that has been generated based on other factors, so I need to use html unicode values to keep the $ signs and quotes from messing up the source PHP.</p> <p>I hope that was clear. Thanks in advance for any help or suggestions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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