RE: [PHP] replace Microsoft characters with standard

From: Date: Thu, 07 Dec 2000 01:51:12 +0000
Subject: RE: [PHP] replace Microsoft characters with standard
Groups: php.general 
Request: Send a blank email to php-general+get-29018@lists.php.net to get a copy of this message
try this: make a page like this: <? for($i=1; $i<=256; $i++) echo "character (".chr($i).") is and ANSII $i<BR>\n"; ?> then just copy on your clipboard the curly-quote you hate so much, and with an CTRL+F and find it on the page. the correspondent number will be it's ASCII value which in RegEx you can use as: ereg_replace(chr(035), '\'', $string); # where 35 is an example of a dummy curly-brace's ASCII num. Hope it's what you needed. Cheers, Maxim Maletsky. -----Original Message----- From: Derek Sivers [mailto:list@hitmedia.com] Sent: Thursday, December 07, 2000 10:45 AM To: php-general@lists.php.net Subject: [PHP] replace Microsoft characters with standard I want to replace Microsoft's curly-quotes with regular html &quot; straight-quotes for any incoming text submitted in a form. (And some other special-character replacements, too.) I know str_replace will do it. BUT - - - How do I find out the character hex values to replace? What IS that little curly-quote character? The "..." elipses character that MS Word creates? (which I want to convert back into 3 periods.) OR: Does PHP4 already have some brilliant function for just this kind of thing? Any advice appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#29018) next »