Write a PHP script which will display the Cars in the following way using array

  • BMW
  • Dastun
  • Honda

Introduction

PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..

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

Result

Write a PHP script which will display the Cars in the following way using array
Write a PHP script which will display the Cars in the following way using array

Leave a Comment