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

How to get a list in a config?

Comments in 'Plugin Development' started by XFuryMCPE, Jan 19, 2016.

  1. XFuryMCPE
    Offline

    XFuryMCPE Active Member Plugin Developer

    Joined:
    Jun 19, 2015
    Posts:
    137
    Plugins:
    2
    Minecraft User:
    XFuriousMC
    Example:

    Code:
    Name:
    - Item1
    - Item2
    - Item3
    I don't know how to check for this. :p
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    //Some ways:
    $items $config->get("Name");

    $sth $config->getAll();
    $items $sth["Name"];

    //You can also foreach it if you need its entries:
    foreach($config->get("Name") as $i){
      
    //Do something
    }
    While $config, as always, is your config file
    XFuryMCPE likes this.
  3. XFuryMCPE
    Offline

    XFuryMCPE Active Member Plugin Developer

    Joined:
    Jun 19, 2015
    Posts:
    137
    Plugins:
    2
    Minecraft User:
    XFuriousMC
    Ohh, okay. Thanks

Share This Page

Advertisement