php如何改变数组key,根据条件
Array([1]=>one[2]=>two[3]=>three)如何改变为Array([a1]=>one[a2]=>two[a3]=>three)让数组的key以字母开...
Array
(
[1] => one
[2] => two
[3] => three
)
如何改变为
Array
(
[ a1] => one
[a2] => two
[a3] => three
)
让数组的key以字母开头,这样怎么实现,求高人解决。项目需要。 展开
(
[1] => one
[2] => two
[3] => three
)
如何改变为
Array
(
[ a1] => one
[a2] => two
[a3] => three
)
让数组的key以字母开头,这样怎么实现,求高人解决。项目需要。 展开
1个回答
2018-06-01
展开全部
foreach($a as $key=>$value){
$b[('a'.$key)]=$a[$key];
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询