how to ignore first loop and continue from second in foreach?

php

Solution

$counter = 0;

foreach($doc->getElementsByTagName('a') as $a){
foreach($a->getElementsByTagName('img') as $img){

   if ($counter++ == 0) continue;

   echo $a->getAttribute('href');
   echo $img->src . '<br>';
}
}

Problem

I use foreach loop but it always gives an wierd result in the first but others are fine so i want to remove 1st loop and continue from 2nd... My code is ``` foreach($doc->getElementsByTagName('a') as $a){ foreach($a->getElementsByTagName('img') as $img){ echo $a->getAttribute('href'); echo $img->src . '<br>'; } } ```

Original source