Re: strip_tags not recognising comments
| From: | Wico de Leeuw | Date: | Thu, 24 Aug 2000 15:45:18 +0000 |
| Subject: | Re: strip_tags not recognising comments | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13449@lists.php.net to get a copy of this message | ||
At 17:41 24-8-00 +0200, Wico de Leeuw wrote:
At 11:23 24-8-00 -0400, Matthew Luchak wrote:btw it doens't stip javascript to Greetz, Wicohey all, Thanks to those who answered my previous question "split array". I put my solution at the bottom of this mail for those interested (I neglected to say i need to use PHP3). On to the question at hand. Using strip_tags to parse out HTML chokes on comments that include URLS ie:<!-- <a href="NNN">MMM</a> --> gives MMM</a> --
I tried: ereg_replace ("<!--.*-->"," ",$text); before striping the tags but this removes the <title> tag (most likely more than that but this is the obvious fault). Any insight on this?Try: Preg_Replace ("'(<!--.*?-->)'", "", $text);################################## $ind=0; $newstuff = array(); while (list($i,$v)=each($stuff)) { if (strlen($v)>750) {-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.netfor($j=0;$j<strlen($v);$j+=750){ $newstuff[$ind++]=substr($v,$j+1,750); }} else {$newstuff[$ind++]=$v;} } ################################## Matthew Luchak Senior Developer Special Projects Mamma.com http://www.62662.com http://www.Mamma.com tel: 514-908-4336 matthew@mamma.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net