Reputation: 83
How to convert PHP array into Yaml?
Upvotes: 5
Views: 11001
Reputation: 2482
Try using yaml_emit or yaml_parse
Check this link. It is having good explanation of using YAML in Your PHP Projects
Upvotes: 8
Reputation: 15656
You use Yaml PECL package, but this may not always be possible (e.g on shared hosting) since it's not bundled with PHP by default.
Other solution may be to use some PHP library like Symfony's Yaml Component
Upvotes: 10