php中怎样用foreach改变数组的值?

2024-12-19 20:25:23
推荐回答(1个)
回答1:

$table_exchange=array(1,2,3,4,5,6,7,8);

foreach ($table_exchange as $b=>$c){

$table_exchange[$b]="Week_".$c;

}

echo $table_exchange[0];
这样试一试