jbml_decode (string data) ⇒ map
First available: Version 1.13.2
Notes
The JBML format is available to read on my GitHub.
JBML is similar to TOML and INI, making its implementation quick and easy. It does however feature additional data types such as the map ({ x : y }) and like TOML it also features the array/list data type. JBML also supports inline concatenation that allows you to concatenate two string values.
# Basic settings[General]app_name = "MyApp"version = "1.0.0"supported_languages = {"en" : "English", "es" : "Spanish", "fr" : "French"}[UserSettings]theme = "dark"font_size = 12[Network]ips = ["192.168.1.1", "192.168.1.2", "192.168.1.254"]connection_max = 5000enabled = trueport = 8080hosts = ["alpha","omega"]# Database settings[Database]host = "localhost"port = 5432[Database.credentials]username = "admin"password = "secret"
With the above, we can run some code like below to get data out:
YASS
$contents = file_get_contents("network.jbml")$jbml = jbml_decode($contents)print($jbml["General"]["supported_languages"]["en"])
Comments