2007年5月25日 星期五

foreach

$array = array("1"=>"a","2"=>"b","3"=>"c","4"=>"d","5"=>"e");
foreach($array as $key => $val){
$i = 1;
echo $i."@@".$val."
";
$i++;
}

Result:
1@@a
1@@b
1@@c
1@@d
1@@e

沒有留言:

網誌存檔

關於我自己

Aspire freedom , Hope to do Soming make self complete ~