Sequential counting with preg_replace
<p>I'm trying to do some seuqential counting thru a text file full of lines with preg_replace in PHP... While the code below works for me... It's counting in reverse... Anyone know how I can get the results to start from 1 instead of counting down to one??? </p>

<pre><code>$num = count($lines);
$return = preg_replace('%\$postnum%msi','post' . $num, $return);
</code></pre>

<p>It returns:</p>

<pre><code>post10
post9
post8
post7
post6
post5
post4
post3
post2
post1
</code></pre>

<p>I want it to return this: </p>

<pre><code>post1
post2
post3
post4
post5
post6
post7
post8
post9
post10
</code></pre>

<p>Any suggestions?? Thx.</p>
