Questões de Informática · COPS UFLA

InformáticaDesenvolvimento web (HTML, CSS e JavaScript)COPS UFLA 2018

UFLA

Questão de Informática

Página28

Considere o seguinte código PHP abaixo: <?php $html = file_get_contents('http://www.ufla.br/'); $doc = new DOMDocument(); @$doc->loadHTML($html); $tags = $doc->getElementsByTagName('img'); foreach ($tags as $tag) { $id = $tag->getAttribute('id'); if (!$tag->getAttribute('alt')){ if (!$id){ echo $tag->ownerDocument->saveXML($tag); }else{ echo $tag->getAttribute('id'); } } } ?> Assinale a alternativa CORRETA:

Sua resposta

Mais questões de Desenvolvimento web (HTML, CSS e JavaScript)

Ver as 2.763 questões de Desenvolvimento web (HTML, CSS e JavaScript)

Questão de prova oficial, com o gabarito definitivo publicado pela banca. Reproduzida para fins de estudo.