Pallavi
Pallavi

Reputation: 83

How to convert PHP array into Yaml?

How to convert PHP array into Yaml?

Upvotes: 5

Views: 11001

Answers (2)

Suyog
Suyog

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

Jakub Matczak
Jakub Matczak

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

Related Questions