0 debugger posted PHP: how foreach work ? $array = array(1, 2, 3, 4, 5); how to print and manipulate the array with foreach in PHP ? Edit Question
1 eclipse-learner answered Apr 25 '22 00:00 $array = array(1, 2, 3, 4, 5); foreach($array as $value){ echo $value; } above code print all values from the array $array = array("a"=>1, "b"=>2,"c"=>3,"d"=>4, "e"=>5); foreach($array as $value){ echo "Key:".$value; echo "Value:".$value; } above code print all keys and values from the array Edit Answer