Answers for "display elements of the array"

PHP
0

display elements of the array

$max=sizeof($_SESSION['cart']);
for($i=0; $i<$max; $i++) { 

while (list ($key, $val) = each ($_SESSION['cart'][$i])) { 
echo "$key -> $val ,"; 
} // inner array while loop
echo "<br>";
} // outer array for loop
Posted by: Guest on October-14-2021

Code answers related to "display elements of the array"

Browse Popular Code Answers by Language