ereg_replace table row help
Posted: Fri Jan 07, 2005 9:40 am
I have a table which contains several rows of information that I don't want but some rows I do want. It looks like this:
I would like to remove the rows that have the table header lines in them, so I would like to replace this entire line and other lines similar to it.
This regex expression works to do that in a program called the Regex Coach which parses the regular expression.
However, when I try to run it in php, with,
it throws an error about my regex syntax. Any clues?
feyd | Help us, help you. Please use
Code: Select all
<tr><th colspan=3><font size="+1"><strong>Table Header 1</strong></font></th></tr>
<tr><td>cell 1</td><td>cell 2</td><td>cell 3</td></tr>
<th colspan=3><font size="+1"><strong>Table section Header 2</strong></font></th></tr>
<tr><td>cell 1</td><td>cell 2</td><td>cell 3</td></tr>Code: Select all
<tr><th colspan=3><font size="+1"><strong>Table Header 1</strong></font></th></tr>Code: Select all
<tr><th colspan=7>(.*?)</th></tr>Code: Select all
ereg_replace("<tr><th colspan=7>(.*?)</th></tr>","",$table);feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]