7
$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?

Cynial
  • 680
  • 8
  • 23

1 Answers1

0

if you want the output to be 12345:

$arr = array(1,2,3,4,5);

foreach($arr as $key => $val) {
    echo $val;
}
low_rents
  • 4,481
  • 3
  • 27
  • 55