If I have an array in JS like this:
{
"car": "BMW",
"count": 7
}
I can generate it from PHP quite easy using this array:
array(
'car' => 'BMW',
'count' => 7,
)
and json_encode. This is not a problem.
But what if I have an array in JS like this:
{
"center": new google.maps.LatLng(-34.397, 150.644),
"zoom": 8
}
is there also some nice way how to produce it from PHP?
The method above fails because JSON put quotes around "new google.maps.LatLng(-34.397, 150.644)".