note 15135 deleted from function.htmlentities by jimw

From: Date: Mon, 17 Dec 2001 22:29:10 +0000
Subject: note 15135 deleted from function.htmlentities by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23022@lists.php.net to get a copy of this message
This is a very good function to delete all html-tags but it won't delete the text between the tags. function delete_html($form_name) { $form_name = str_replace("[", "", "$form_name"); $form_name = str_replace("]", "", "$form_name"); $not ="\"'*\abcdefghijklmnopqrstuvwxyz1234567890áéíóúýâêîôûàèìòùçäëïöüÿ=~`@#$%^&*()_{}\n\t\r\ /;:.!?,+-"; $form_name = eregi_replace("(</)+[$not]+(>)", "", "$form_name"); $form_name = eregi_replace("(<)+[$not]+(>)", "", "$form_name"); $form_name = str_replace("<", "", $form_name); $form_name = str_replace(">", "", $form_name); $form_name = htmlspecialchars($form_name); return $form_name; } $message = delete_html($message);

« previous php.notes (#23022) next »