怎么把数组键名键值重置
程序员文章站
2022-03-29 23:28:47
...
array(6) {
[0] => string(6) "品牌"
[1] => string(6) "ABC"
[2] => string(6) "颜色"
[3] => string(20) "黄色|红色|黄色"
[4] => string(6) "型号"
[5] => string(18) "20FGH-111"
}
结果:
array(3) {
["品牌"] => string(6) "ABC"
["颜色"] => string(20) "黄色|红色|黄色"
["型号"] => string(18) "20FGH-111"
}
完全没有头绪啊,谢谢。
[0] => string(6) "品牌"
[1] => string(6) "ABC"
[2] => string(6) "颜色"
[3] => string(20) "黄色|红色|黄色"
[4] => string(6) "型号"
[5] => string(18) "20FGH-111"
}
结果:
array(3) {
["品牌"] => string(6) "ABC"
["颜色"] => string(20) "黄色|红色|黄色"
["型号"] => string(18) "20FGH-111"
}
完全没有头绪啊,谢谢。
回复讨论(解决方案)
for($i=0; $i