$fruits = array("Apple", "Orange", "Banana"); // print by using index echo $fruits[0] .'
'; // loop through each element foreach($fruits as $fruit) { echo $fruit .'
'; } // trying to echo whole array echo "
Trying to echo whole array
"; echo $fruits;
Hello World!