Recently I am writing a PHP extension, which involves a YAML file parsing function... there are currently two solutions: Use a third-party YAML Library (pyyaml. orgwikiLibYAML), the disadvantage is that the third library needs to be installed during the installation of the extension, and this library is not so popular. in... recently I am writing a PHP extension, which involves a YAML file parsing function...
There are currently two solutions:
- With a third-party YAML Library (http://pyyaml.org/wiki/LibYAML), the disadvantage is that the third library needs to be installed when installing the extension, and this library is not so popular.
- Implement a YAML File Parsing in the extension by yourself. The disadvantage is that it is time consuming...
Please give me an idea ~
Reply content:
Recently I am writing a PHP extension, which involves a YAML file parsing function...
There are currently two solutions:
- With a third-party YAML Library (http://pyyaml.org/wiki/LibYAML), the disadvantage is that the third library needs to be installed when installing the extension, and this library is not so popular.
- Implement a YAML File Parsing in the extension by yourself. The disadvantage is that it is time consuming...
Please give me an idea ~
Install a third-party library. The syntax of YAML is much more complex than that of JSON, and it is not easy to implement.
It is better to compile PECL if the environment can be modified, or use spyc.
The Symfony2 framework comes with the YAML parsing function, which is componentized and can be used independently.