"163", "rand" => "630", "om" => "43", "wor-6ren">
gpt4 book ai didi

PHP 数组键值

转载 作者:可可西里 更新时间:2023-11-01 13:06:10 25 4
gpt4 key购买 nike

我有一个像这样的数组

$data = array(
"some" => "163",
"rand" => "630",
"om" => "43",
"words" => "924",
"as" => "4",
"keys" => "54"
);

如何让每个集合的键像这样与其值相关联:

foreach ($data as $stuff){
$this->$stuff["key"] = $stuff["value"];
}

最佳答案

foreach ($data as $key => $value){
echo "$key => $value\n";
}

关于PHP 数组键值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3722484/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com