How can I obtain the ID from the following example string?
<p>I use the following method to pad out a ID for a property on our website:</p>

<pre><code>function generateAgentRef($id,$length=5,$strPrefix='1'){
    return $strPrefix . str_pad($id,$length,0,0);
}
</code></pre>

<p>Basically it will prefix 1 and then pad out the id with 0's until the string reaches $length.</p>

<p>But, I now have a requirement to revert this process. For example if I have the following IDs: 100650,100359,100651,100622,100112,100687, how can I get the ID e.g. 650, 359, 651, 622, 112, 687?</p>

<p>Hope this explains what I'm trying to achieve.</p>

<p>The ID in the database will never start with 0, so I was thinking of iterating over the components of the string and detecting when I hit something other than 0 and then splitting the string.</p>
