Reputation: 13051
i'm trying to parse an html page and get the first occurrence of a tag using method find
.. this is what i try
$master = file_get_html($link);
$link1 = $master->find("span.cl");
i need to do something like
$link1[0]
is there a way to do it?
Upvotes: 2
Views: 2471
Reputation: 42612
Try something like this:
$link1 = $master->find('a', 0);
this finds the first <a>
for example.
Upvotes: 4