What i need to do is to replace all pre tags with code tags.
Example
<pre lang="php">
echo "test";
</pre>
Becomes
<code>
echo "test";
</code>
<pre lang="html4strict">
<div id="test">Hello</div>
</pre>
Becomes
<code>
<div id="test">Hello</div>
</code>
And so on..
Default DOM functions of php have a lot of problems because of the greek text inside.
I think Simple HTML DOM Parser is what i need but i cant figure out how to do what i want.
Any ideas?
UPDATE
Im moving to a new CMS thats why im writing a script to format all posts to the correct format before inserting into DB. I cant use pre tags in the new CMS.
Why not KISS (Keep It Simple, Stupid):