Forum Moderators: coopster

Message Too Old, No Replies

Deleting HTML tag contents using PHP

Removing a certain tag and its contents

         

Kadence

8:38 am on Mar 11, 2004 (gmt 0)

10+ Year Member



Say I'm parsing an HTML file, and I want to delete the 2nd table in the file. That is, I want to produce another HTML file that is the same, except the new one does not contain the 2nd table from the original.

How would I go about finding the 2nd <table> tag, and then how would I go about deleting everything between that tag and the next </table> tag?

Birdman

12:48 pm on Mar 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are a few ways to accomplish what you want. This page should give you all the info you need:

PHP: Regular Expression Functions [php.net]

Birdman