MCQs > IT & Programming > PHP > What will be the output ? background-color#FFFcolor#333font-familyVerdana, Geneva, sans-serif'; $xml = simplexml_load_string($xmlFile); foreach($xml->css as $css) { echo (string) $css->element['id'].'{'; foreach($xml->css->element->csstag as $tag) { $temp = $tag->title.': '.$tag->value.';'; echo $temp; } echo '}'; } ?>

PHP MCQs

What will be the output of the following code? <?php $xmlFile = "<root><css><element><csstag><title>background-color</title><value>#FFF</value></csstag><csstag><title>color</title><value>#333</value></csstag><csstag><title>font-family</title><value>Verdana, Geneva, sans-serif</value></csstag></element></css></root>"; $xml = simplexml_load_string($xmlFile); foreach($xml->css as $css) { echo (string) $css->element['id']."{"; foreach($xml->css->element->csstag as $tag) { $temp = $tag->title.": ".$tag->value.";"; echo $temp; } echo "}"; } ?>

Answer

Correct Answer: {background-color: #FFF;color: #333;font-family: Verdana, Geneva, sans-serif;}

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it