Re: Text corruption when storing to MySql

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

 



I missed a variable in my previous post....should have been this:


$submitted_text = $_POST['textFromForm'];

function clean_ms_word($submitted_text)
{
$crap = array(chr(0x82),chr(0x83),chr(0x84),chr(0x85),chr(0x86),chr(0x87),chr(0x88),chr(0x89),chr(0x8a),chr(0x8b),chr(0x8c),chr(0x91),chr(0x92),chr(0x93),chr(0x94),chr(0x95),chr(0x96),chr(0x97),chr(0x98),chr(0x99),chr(0x9a),chr(0x9b),chr(0x9c),chr(0x9f));
$clean = array('‚','ƒ','„','&ldots;','†','‡','','‰','Š','‹','Œ','‘','’','"','"','•','–','—','˜','™','š','›','œ','Ÿ');
$content = str_replace($crap,$clean,$writing);
return $content;
}


$usable = clean_ms_word($submitted_text);


HTH,

Roger

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux