Showing posts with label Fruits Listing Using Two Dimensional Arrays in PHP. Show all posts
Showing posts with label Fruits Listing Using Two Dimensional Arrays in PHP. Show all posts

Monday, July 15, 2019

Fruits Listing Using Two Dimensional Arrays in PHP

Here is a simple program to show you how to use two-dimensional array in PHP in our example we are dealing with different kinds of fruits.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output


Program Listing

two.php

<!DOCTYPE html>
<html>
<body>

<?php


$fruits = array
  (
  array("Avocado",21,16),
  array("Banana",13,18),
  array("Santol",15,54),
  array("Mango",12,45),
  array("Orange",65,16),
  array("Cherry",32,44),
  array("Pear",651,125),
  array("Apricot",321,78)
  );
  
echo "<h2> Fruits Listing Using Two Dimensional Arrays in PHP </h2>";

for ($row = 0; $row < 8; $row++) {
  echo "<p><b>Row number $row</b></p>";
  echo "<ul>";
  for ($col = 0; $col < 3; $col++) {
    echo "<li>".$fruits[$row][$col]."</li>";
  }
  echo "</ul>";
}
?>

</body>
</html>