Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to remove nested content in a config?

Comments in 'Plugin Development' started by CraftYourBukkit, Jul 24, 2015.

  1. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I have a config like this:
    Code:
    hi:
       bye:
          p: 1
    And I want to remove bye. I tried to use Config::remove(); which didn't work. I also tried to set it on null, which did work but conflicts with something else, so I can't use that. Is there any other method to fully remove it?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    $hi $config->get("hi");
    unset(
    $hi["bye"]);
    $config->set("hi"$hi);
    CraftYourBukkit likes this.
  3. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Thanks!

Share This Page

Advertisement