我正在编写PHP工具来编辑lighttpd.conf(Lighttpd webserver)。
lighttpd.conf风格:
variable = value
variable = 1
variable = "value space"
我可以使用上面的样式工作,但lighttpd.conf也有多级数组的数组样式:
variable = ("key" => (
"multi-key" => (
"subkeya" => "value",
"subkeyb" => "value")
)
)
如何在php中解析并将其转换为数组?
像:
$variable[variable] = "value";
$variable[variable] = array("key" => array("subkey" => "value");