Q:

Write a PHP script which will display the colors in the following way

0

$color = array('white', 'green', 'red'')
Write a PHP script which will display the colors in the following way.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$color = array('white', 'green', 'red');
foreach ($color as $c)
{
echo "$c, ";
}
sort($color);
echo "<ul>";
foreach ($color as $y)
{
echo "<li>$y</li>";
}
echo "</ul>";
?>

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now