plemieux
Joined: 11 May 2005
Posts: 20
Posted: 2005-09-16 22:15
Back to top
Reply with quote
|
I'd like to encode some special characters not covered by htmlspecialchars() function.
I would like to apply the following function to all text fields:
Code: |
function CleanupSmartQuotes($text) {
$badwordchars=array(
chr(145), //lsquo
chr(146), //rsquo
chr(147), //ldquo
chr(148), //rdquo
chr(151) //mdash
);
$fixedwordchars=array(
"‘",
"’",
'“',
'”',
'—'
);
return str_replace($badwordchars,$fixedwordchars,$text);
} |
Do I need to modify PME class? If so, what part do I need to modify?
|
Post new topic
Reply to topic
|
|
|