I have the following file:
<p>
<a href="a1">A1</a>
<a href="a2">A2</a>
<a id="a3">A3</a>
<a href="a4">A4</a>
</p>
I need to skip the a
tags from within the list obtained by $para->look_down("tag"=>'a');
, which have an id attribute equal to some value.
I am doing:
$str = '';
$str = $anchor->attr('id');
if ($str != 'a3') {
last;
}
This does not work when id
attribute is not defined: it breaks out of the loop. How to do this?