Skip to content
Advertisement

How to add json with fixtures

On symfony I am trying to add some fixtures to the database some of which requires json format.

I tried :

JavaScript

I tried different other variations but in vain

what is the correct way to do it?

Advertisement

Answer

You need to use the function json_encode to convert it into json.

JavaScript

Output: {"France":29}

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement