note 16581 deleted from function.ereg-replace by jimw
| From: | jimw@php.net | Date: | Thu, 08 Nov 2001 00:09:11 +0000 |
| Subject: | note 16581 deleted from function.ereg-replace by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20586@lists.php.net to get a copy of this message | ||
I spent hours trying to figure out how to strip "s from only inside the HTML tags which is
useful if you are previewing your HTML before it goes live from a form input. What I came up with is
the following. It may not be the best, but it's all I could come up with. It also replaces
"s not inside HTML tags with ".
while
(ereg("(<[^\"|>]*)\"([^\"|>]*)\"([^>]*>)",$body)){
$body =
ereg_replace("(<[^\"|>]*)\"([^\"|>]*)\"([^>]*>)","\\1\\2\\3",
$body);
} $body = ereg_replace("\"",""",$body);