如何用 PHP 解析这种文本格式?
How can I parse this text format with PHP?
如何使用 PHP 解析这些数据?我不认识格式。字段名称似乎由 [a-z]
和 _
组成。子字段应缩进 2 个空格。
---
field_name:
sub_field: This is text content
sub_field1: |-
This is multiline text content. This is multiline text content. This is multiline text content.
This is multiline text content.
Thanks
number_field: 2
another_field: ''
array_field: []
field_name1:
sub_field_with_empty_value:
note: single line text field can have serveral lines
this is also 'note' field
...
这是一个YAML file. See the PHP YAML parsing reference。
如何使用 PHP 解析这些数据?我不认识格式。字段名称似乎由 [a-z]
和 _
组成。子字段应缩进 2 个空格。
---
field_name:
sub_field: This is text content
sub_field1: |-
This is multiline text content. This is multiline text content. This is multiline text content.
This is multiline text content.
Thanks
number_field: 2
another_field: ''
array_field: []
field_name1:
sub_field_with_empty_value:
note: single line text field can have serveral lines
this is also 'note' field
...
这是一个YAML file. See the PHP YAML parsing reference。