note 50682 added to function.htmlentities

From: Date: Mon, 07 Mar 2005 10:29:17 +0000
Subject: note 50682 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-86033@lists.php.net to get a copy of this message
I use this function: function formatvalue( $text ) { $text = (string)$text; $text = htmlentities($text, ENT_QUOTES); $entities = array(/*"'" => "'",*/ "€" => "€", "‚" => "‚", "ƒ" => "ƒ", "„" => "„", "…" => "…", "†" => "†", "‡" => "‡", "ˆ" => "ˆ", "‰" => "‰", "Š" => "Š", "‹" => "‹", "Œ" => "Œ", "‘" => "‘", "’" => "’", "“" => "“", "”" => "”", "•" => "•", "–" => "–", "—" => "—", "˜" => "˜", "™" => "™", "š" => "š", "›" => "›", "œ" => "œ", "Ÿ" => "&Yuml"); foreach( $entities as $char => $entity ) $text = str_replace($char,$entity,$text); return $text; } ---- Manual Page -- http://www.php.net/manual/en/function.htmlentities.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50682 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50682&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50682&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50682&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50682&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50682&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50682&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86033) next »