note 61853 added to function.chr

From: Date: Mon, 13 Feb 2006 22:52:02 +0000
Subject: note 61853 added to function.chr
Groups: php.notes 
Request: Send a blank email to php-notes+get-103647@lists.php.net to get a copy of this message
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 -- http://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.php.net/manage/user-notes.php?action=delete+61853&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61853&report=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://master.php.net/manage/user-notes.php

« previous php.notes (#103647) next »