I need a little help with some PHP replace functions. I have a variable called $line that holds all of the HTML output generated by my script.
I need to replace some of the HTML in $line. Anytime there is a table with
bgColor=#dddddd
I want to remove the entire contents of the table. Here\'s an example:
$line = \"something\";
$line .= \"<table cellpadding=1 bgColor=#dddddd border=0><tr><td>\";
$line .= \"text here\";
$line .= \"</td></tr></table>\";
$line .= \"<br>something else\";
After I run a replace or regex on $line and echo it to the browser it should output:
something
something else
No more table. The regex I am trying to use is
$line = eregi_replace(\"<TABLE(.)bgColor=#dddddd(.)>(.*)</TABLE>\",\" \",$line);
When I plug in a $line variable that contains some simple HTML like the code above, it does work. However, in the scheme of my big script it does not.
Could someone take a look at my script and try to help me? I think the problem might be related to newlines or spaces.
CODE: http://www.searchace.net/phod.txt
OUTPUT: http://www.searchace.net/phod.php
The regex is on line 214. Notice those grey tables? Those are what I am trying to get rid of.
Thanks for the help!