What is the shortest code to add/remove an element out of an config's array? Example: Code: worlds: - "World1" - "World2" - "World3" to Code: worlds: - "World1" - "World2" - "World3" - "World4" Maybe there's something like this? Code: $this->getConfig()->add("anything", $myarray");
PHP: $arr = $this->getConfig()->get("anything");$arr[] = "World4";$this->getConfig()->set("anything", $arr);
Note that it is faster to remove a key from an array than searching a value and remove its associated key.