I have thousands of lines of code like this:
var coordinates = [
new google.maps.LatLng(11.11111, 22.222222),
new google.maps.LatLng(33.33333, 44.444444),
new google.maps.LatLng(55.55555, 66.666666),
//Thousands of lines
];
I need to format code above to array of LatLng arrays containing Lat and Lng separately:
[0] => [lat] => [11.11111], [lng] => [22.22222]
[1] => [lat] => [33.33333], [lng] => [44.44444]
[2] => [lat] => [55.55555], [lng] => [66.66666]
//etc
Doing it one by one on my own would take forever. I need to hardcode the outcome to my code which means it would be best if I could build a frontend converter with (2) textarea(s) where I could copy my 1st code, press button and get the results which I could copy-paste to my own code.
PHP and JS both works for me, choose the language you like.
How to get numbers from my 1st block of code and build the structure in my second code?