i used old version of fckeditor for some time and now i'm about to switch to xhtml-compatible.
but i found that old data are not xhtml-compatible and some tags are not closed properly.
so i write a php script and hope it's useful for those who need it.
<?php mysql_connect('localhost', 'USERNAME', 'PASSWORD'); mysql_select_db('DATABASE'); mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary"); $result = mysql_query("SELECT ROWid, ROWdata FROM TheTABLE"); while($data = mysql_fetch_assoc($result)) { $doc = new DOMDocument('1.0', 'utf8'); @$doc->loadHTML('<meta http-equiv="Content-Type" content="text/html;charset=utf-8"><body>' . $data['ROWdata] . '</body>'); // depend on if your material is a whole html or a fragment $b = $doc->saveXML($doc->getElementsByTagName('body')->item(0)); // depend on if you only want body->innerHTML $b = str_replace(array('<body>', '</body>'), '', $b); // depend on if you only want body->innerHTML $b = str_replace('/>', ' />', $b); mysql_query("UPDATE TheTABLE SET ROWdata='" . addslashes($b) . "' WHERE bt_data_id = " . $bt_data['ROWid']); }