$arr = array(1,2,3,4,5);
foreach($arr as $key => $row) {
echo current($arr);
}
//output is 22222, why?
Why the result is not 12345?
$arr = array(1,2,3,4,5);
foreach($arr as $key => $row) {
echo current($arr);
}
//output is 22222, why?
Why the result is not 12345?
if you want the output to be 12345:
$arr = array(1,2,3,4,5);
foreach($arr as $key => $val) {
echo $val;
}