note 15135 added to function.htmlentities

From: Date: Wed, 29 Aug 2001 12:28:16 +0000
Subject: note 15135 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-17296@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); http://www.php.net/manual/en/function.htmlentities.php

« previous php.notes (#17296) next »