PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The problem is this: I am trying to generate a PDF document. But because there is HTML in the header.php the PDF generation page show a whole bunch of garbage. Is there anyway to parse the page.php and remove the HTML at the same time. I understand that I can put if statements for the header and footer. Can it be done? Removing HTML on php execution, could be quite handy.
I use this kind of thing for making a printable version of my page by removing most colors and making the page more document like by disabling all the links and forms etc.
I see no reason why it couldnt be used to remove html tags, but for that you'll need preg_raplace rather than str_replace.