Re: HTML formatting

From: Date: Fri, 28 Jun 2002 12:48:25 +0000
Subject: Re: HTML formatting
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-104302@lists.php.net to get a copy of this message
Actually, I just threw in this amendment: function CleanUpHtml($var) { $var = preg_replace("!<t(a|r|d)(.*?)style=\".*?\"(.*?)>!is", "<t$1$2$3>", $var); $var = preg_replace("!<table.*?>!is", "<TABLE border=1 bordercolor='#666666' cellpadding=3 cellspacing=0>", $var); $var = str_replace("<p>", "", $var); $var = str_replace("<P>", "", $var); $var = str_replace("</p>", "", $var); $var = str_replace("</P>", "", $var); preg_match_all("!<(/?t.*?)>!is", $var, $output); if (count($output[0]) > 0) { for($i=0; $i<count($output[0]); $i++) { $var = str_replace($output[0][$i], strtolower($output[0][$i]), $var); } } return $var; } and now all of the table tags are lowercase. Much nicer. -J

« previous php.general (#104302) next »