Hello, there is a line coming with PHP in JS.
var locs=`[{"0":0,"info":"249","lat":"50.908","lng":"34.798"},{"1":1,"info":"400","lat":"50.908","lng":"34.798"}]`; Need a view in js:
var locs = { "1": {"info": "11111. Some random info here", "lat": "-37.8139", "lng": "144.9634"}, "2": {"info": "22222. Some random info here", "lat": "46.0553", "lng": "14.5144"}, "3": {"info": "33333. Some random info here", "lat": "-33.7333", "lng": "151.0833"}, "4": {"info": "44444. Some random info here", "lat": "7.9798", "lng": "-81.731"} }; Now json_decode () gives the following form:
Array ( [0] => stdClass Object ( [0] => 0 [info] => 249 [lat] => 50.908 [lng] => 34.798 ) [1] => stdClass Object ( [1] => 1 [info] => 400 [lat] => 50.908 [lng] => 34.798 ) ) How to make proper array look like in PHP? To complete the picture I attach a screenshot: 
json_decodefunction set totrueand get an array, not an object and specify the recursion depth with 3 arguments (in your case 2). And you don’t have to drag out the pictures, let's take less working examples, nobody will rewrite for you. - And