made “foreach”

This may sound obvious but I still want to mention it 😀

<?php
$a = array(
1=>'B',
2=>'C',
3=>'D',
0=>'A',
4=>'E',
);
echo "Using for\n";
$c = count($a);
for($i=0;$i<$c;$i++){
    echo $a[$i],"\n";
}
echo "Using foreach\n";
foreach($a as $k){
    echo $k, "\n";
}
?>
Output is

Using for
A
B
C
D
E
Using foreach
B
C
D
A
E