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..


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. <?php
  2. $color = array('Dastun', 'Honda', 'BMW');
  3. foreach ($color as $c)
  4. {
  5. echo "$c, ";
  6. }
  7. sort($color);
  8. echo "<ul>";
  9. foreach ($color as $y)
  10. {
  11. echo "<li>$y</li>";
  12. }
  13. echo "</ul>";
  14. ?>

Result

python language techstudy.org

     





Related Topics




Popular Posts