这是我的数组:取代PHP数组的所有键
['apple']['some code']
['beta']['other code']
['cat']['other code 2 ']
我怎么能代替所有的“E”字母“!”在键名,并保留值 ,这样我会得到类似的东西
['appl!']['some code']
['b!ta']['other code']
['cat']['other code 2 ']
我发现这一点,但因为我没有相同的名称所有密钥我不能用它
$tags = array_map(function($tag) {
return array(
'name' => $tag['name'],
'value' => $tag['url']
);
}, $tags);
你的阵列不被清除,是多维或者关联数组,请更新您的实际阵列 –