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
  • 670
  • 8
  • 21

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,313
  • 2
  • 23
  • 52