Re: getting rid of bad characters

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

 



Dan McCullough wrote:
I having been looking for some snippet to help me with changing
MS Word double, quotes, single quotes and other characters to
acceptable HTML safe characters.

This seems to work:

$search = array('/[\x07\x95]/',
                '/\x85/',
                '/[\x91\x92]/',
                '/[\x93\x94]/');

$replace = array('-',
                 '...',
                 "'",
                 '"');

$string = preg_replace($search, $replace, $string);

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

--
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