note 74413 added to function.get-html-translation-table
| From: | yes at king22 dot com | Date: | Tue, 10 Apr 2007 15:33:11 +0000 |
| Subject: | note 74413 added to function.get-html-translation-table | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125266@lists.php.net to get a copy of this message | ||
Searching for a fast replacement of the MS WORD special characters which are not covered by
get_html_translation_table() , I think the following function might help someone
<?php
function clean_up($str){
$str = stripslashes($str);
$str = strtr($str, get_html_translation_table(HTML_ENTITIES));
$str = str_replace( array("\x82", "\x84", "\x85", "\x91",
"\x92", "\x93", "\x94", "\x95", "\x96",
"\x97"), array("‚", "„", "…",
"‘", "’", "“", "”",
"•", "–", "—"),$str);
return $str;
}
?>
It replaces all types of quotes (single and double), horizontal ellipsis (...), bullet, en dash and
em dash.
----
Server IP: 217.160.72.57
Probable Submitter: 88.64.151.148
----
Manual Page -- http://www.php.net/manual/en/function.get-html-translation-table.php
Edit -- https://master.php.net/note/edit/74413
Del: integrated -- https://master.php.net/note/delete/74413/integrated
Del: useless -- https://master.php.net/note/delete/74413/useless
Del: bad code -- https://master.php.net/note/delete/74413/bad+code
Del: spam -- https://master.php.net/note/delete/74413/spam
Del: non-english -- https://master.php.net/note/delete/74413/non-english
Del: in docs -- https://master.php.net/note/delete/74413/in+docs
Del: other reasons-- https://master.php.net/note/delete/74413
Reject -- https://master.php.net/note/reject/74413
Search -- https://master.php.net/manage/user-notes.php