Re: parsing/replacing for special MS Word characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I Dan McCullough wrote:
I have a friend who I wrote some very simple publishing software,
basically he takes his writtings and puts them online.  Well his
writtings are in Word and so he has alot of special characters that he
inputs, some unknowingly, into the database.  Are there any classes or
samples of what others have done to strip/replace/find these special
characters, I have asked him to be careful, but he will do it once or
twice and then forget and lapse, and I get a call saying can you help
me get these out.

Any idea

I use in the header <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >

Then for the uploaded text:
$translate_array= array(		//converts MS chars to html; this will catch most of them
		chr(133)=> '...',
		chr(145)=> '\'',
		chr(146)=> '\'',
		chr(147)=> '"',
		chr(148)=> '"',
		chr(150)=> '-',
		chr(151)=> '-',
	);

$str= strtr($str, $translate_array);	

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux