note 26379 added to function.htmlentities
| From: | kumar at rack1 dot php dot net | Date: | Mon, 28 Oct 2002 23:51:50 +0000 |
| Subject: | note 26379 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38674@lists.php.net to get a copy of this message | ||
without heavy scientific analysis, this seems to work as a quick fix to making text originating from
a Microsoft Word document display as HTML:
function DoHTMLEntities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
// MS Word strangeness..
// smart single/ double quotes:
$trans_tbl[chr(145)] = '\'';
$trans_tbl[chr(146)] = '\'';
$trans_tbl[chr(147)] = '"';
$trans_tbl[chr(148)] = '"';
// é :
$trans_tbl[chr(142)] = 'é';
return strtr ($string, $trans_tbl);
}
--
http://www.php.net/manual/en/function.htmlentities.php
http://master.php.net/manage/user-notes.php?action=edit+26379
http://master.php.net/manage/user-notes.php?action=delete+26379
http://master.php.net/manage/user-notes.php?action=reject+26379