[ create a new paste ] login | about

Link: http://codepad.org/RKFka0td    [ raw code | output | fork ]

shaheer912 - PHP, pasted on Apr 10:
1
2
3
4
5
6
7
8
9
10
11
<?php

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

foreach ($array as $key => &$item) {
//echo "$item\n";
$item = 1;
echo $array[$key];
echo "\n";
reset($array);
}


Output:
1
2
3
4
5
1
1
1
1
1


Create a new paste based on this one


Comments: