As we know foreach loop will execute till condition does not become false. I want to execute it only once.
$i=0;
foreach($html->find('img') as $element)
{
if($i!=0)
break;
$logo= $element->src . '<br>';
$i++;
}
Is there any other solution for this? like foronce
in place of foreach
?