我正在尝试解析具有以下结构的文件:
Page: name of page
Lang: language
{1} content of a header
{2} content of a paragraph
Lang: language
{1} content of a header
{2} content of a paragraph
Page: name of page
Lang: language
{1} content of a header
{2} content of a paragraph
等等。
我从云中获取此类内容,保存到文件中,然后我想将每个页面作为关联数组获取,格式如下:
page => page 1
[lang] => language A
[1] => content of a header
[2] => content of a paragraph
[lang] => language B
[1] => content of a header
[2] => content of a paragraph
page => page 2
[lang] => language A
[1] => content of a header
[2] => content of a paragraph
[lang] => language B
[1] => content of a header
[2] => content of a paragraph
...
我一直在尝试从文件构建整个数组,然后开始按标签分组,但我一直没有成功。:/