PHP array copying error
<p>when I'm trying to copy an array's element to another using php</p>

<pre><code>$new=array();
for($i=0;$i&lt;$num;$i+3){
$new[] = $old[$i];
}
</code></pre>

<p>it is throwing an error <code>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 35 bytes)</code></p>

<p>I need to copy <code>old</code>'s element into <code>new</code> by skipping two elements in between (I need 1st, 4th, 7th elements .. skipping 2nd&amp;3rd, 5th&amp;6th, 8th&amp;9th) <br><br></p>

<p>suggest me how </p>

<p><strong>update:solved---sry its typo error...</strong> its silly but i starred @ my code for 15min and not found my typo error...am copying the code, how i rectified </p>

<pre><code>$new=array();
for($i=0;$i&lt;$num;$i+=3){
$new[] = $vdo[$i];
}
</code></pre>
