note 16571 added to function.eregi-replace

From: Date: Sun, 04 Nov 2001 19:06:01 +0000
Subject: note 16571 added to function.eregi-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-20428@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 &quot. while (eregi("(<[^\"|>]*)\"([^\"|>]*)\"([^>]*>)",$body)){ $body = eregi_replace("(<[^\"|>]*)\"([^\"|>]*)\"([^>]*>)","\\1\\2\\3", $body); } $body = eregi_replace("\"","&quot",$body); -- http://www.php.net/manual/en/function.eregi-replace.php http://master.php.net/manage/user-notes.php?action=edit+16571 http://master.php.net/manage/user-notes.php?action=delete+16571 http://master.php.net/manage/user-notes.php?action=reject+16571

« previous php.notes (#20428) next »