public static function getOther($key = false, $json = false) { $sc = new self(); $sc->castOtherConfigIfNotExist(); $options = (object) simplexml_load_file(NODE_REAL_PATH . "config/other-cfg.xml"); // dump($options); $result = []; foreach ($options as $option) { $opt = new stdClass(); $opt->description = $option['description']; $opt->name = $option['name']; $opt->value = $option['value']; $result[] = $opt; } if ($key) { $search = false; foreach ($result as $option) { if ($option->name == $key) { $search = $option; } } if ($json) { print json_encode($search->value); } else { return $search->value; } } else { if ($json) { print json_encode($result); } else { return $result; } } }