Answers for "How array is declared in php? What is the role of foreach loop in php explain with ex"

PHP
3

foreach in php

<?php
// Declare an array 
$arr = array("green", "blue", "pink", "white");  
  
// Loop through the array elements 
foreach ($arr as $element) { 
    echo "$element "; 
} 
?>
Posted by: Guest on July-09-2020

Code answers related to "How array is declared in php? What is the role of foreach loop in php explain with ex"

Browse Popular Code Answers by Language