how do I restrict this loop to a specific number?
<p>how do I restrict this loop to get only 6 values?</p>

<pre><code>  $countries = array();
foreach ($my_data as $node)
{   
    foreach($node-&gt;getElementsByTagName('a') as $href)
    {   

        $countries[] = strip_tags(trim($href-&gt;nodeValue)); 


    }
}
</code></pre>
