我有很多想要存储到数组中的变量
$colors = array("red", "green", "blue", "yellow");
foreach ($colors as $value) {
echo "$value <br>";
}
现在我希望将$ $值再次存入数组
p.s:看起来很愚蠢,但这是教育目的请不要告诉我为什么我已经做了$ colors array is exits
答案 0 :(得分:0)
$colors = array("red", "green", "blue", "yellow");
foreach ($colors as $key => $value) {
$value = strtoupper($value);
$colors[$key] = $value;
}