Question

I'm looking for strings in a file and save them to a yml file.
When the string is one word like Map it shows Map in the yml file. But if the string is Permit Total I get 'Permit Total'.

How can I fix this? (That it just prints Permit Total)

I'm using the symfony\yaml library.

Était-ce utile?

La solution

In YAML, single and double quotes are used to denote a String and aren't actually part of the String value. In other words, Map and 'Map' are equivalent.

When you parse the YAML file to retrieve a String with double or single quotes around it, the quotes won't be included.

Take a look: http://en.wikipedia.org/wiki/YAML#Syntax

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top