【发布时间】:2017-12-24 08:26:36
【问题描述】:
我需要从字符串中删除数组中的一个键。
字符串是translations.fr
数组是
[
...,
translations => [
fr => [
...
],
es => [
...
]
],
...,
]
结果必须是:
[
...,
translations => [
es => [
...
]
],
...,
]
我认为,使用exlpode 和unset 是个好方法。
你能帮帮我吗?谢谢
【问题讨论】:
-
为此使用 php unset() 方法
-
unset($translation_arr['fr']);会起作用。 -
@NanaPartykar 是的,但是如何从字符串构建密钥 ['fr'] ?
-
粘贴你的工作代码@NicolasLamblin