I found this function useful as a way to detect and to
replace Microsoft Smart Quotes when desplaying info on a
webpage.
The following lines seem to do the trick:
<?php
$text = "string containing Microsoft Smart
Quotes...";
$chrs = array (chr(150), chr(147), chr(148), chr(146));
$repl = array ("-", "\"",
"\"", "'");
$text = str_replace($chrs, $repl, $text);
?>
----
Server IP: 64.71.164.2
Probable Submitter: 207.189.98.44
----
Manual Page -- http://
www.php.net/manual/en/function.chr.php
Edit -- http://master.php.net/manage/user-notes.php?action=
edit+61853
Delete: added to the manual -- htt
p://master.php.net/manage/user-notes.php?action=delete+61853
&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.
php.net/manage/user-notes.php?action=delete+61853&report
=yes&reason=bad+code
Delete: spam -- http://master.php.
net/manage/user-notes.php?action=delete+61853&report=yes
&reason=spam
Delete: useless -- http://master.p
hp.net/manage/user-notes.php?action=delete+61853&report=
yes&reason=useless
Delete: non-english -- http://mast
er.php.net/manage/user-notes.php?action=delete+61853&rep
ort=yes&reason=non-english
Delete: already in docs -- http://
master.php.net/manage/user-notes.php?action=delete+61853&
;report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-
notes.php?action=delete+61853&report=yes
Reject -- http://master.php.net/manage/user-
notes.php?action=reject+61853&report=yes
Search -- http://ma
ster.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|