php converting preg_replace to preg_replace_callback
<p>I'm working on this old code, and ran across this - which fails:</p>

<pre><code>preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $sObject);
</code></pre>

<p>It tells me that preg_replace e modifier is deprecated, and to use preg_replace_callback instead.</p>

<p>From what I understand, I am supposed to replace the <code>'s:'.strlen('$2').':\"$2\";'</code> part with a callback function that does the replacement on the match.</p>

<p>What I DON'T quite get, is exactly what the regexp is doing that I'll be replacing. It's part of a bit to take php serialized data stuffed in a database field (dumb, I know ...) with broken length fields and fix them for reinsertion.</p>

<p>So can anybody explain what that bit is doing, or what I should replace it with?</p>