0

I have a multi array like this in php:

{"0":{"lat":"49.15522294","lng":"-0.30932379","name":"CGO VI GRENTHEVILLE"},"1":{"lat":"48.10098894","lng":"-1.62358814","name":"CGO VI Rennes Cesson"}}

But when I put this code in a Twig template in a big Object I have this:

locations: "{\"0\":{\"lat\":\"49.15522294\",\"lng\":\"-0.30932379\",\"name\":\"CGO VI GRENTHEVILLE\"},\"1\":{\"lat\":\"48.10098894\",\"lng\":\"-1.62358814\",\"name\":\"CGO VI Rennes Cesson\"}}

Why are backslashes added?

Please help thanks

Pippo
  • 2,173
  • 2
  • 3
  • 16
  • Does this answer your question? [Use Javascript to access a variable passed through Twig](https://stackoverflow.com/questions/13928729/use-javascript-to-access-a-variable-passed-through-twig) – Pippo Jun 18 '23 at 20:41

0 Answers0