<?php
function Descompacta($string) {
$myArray = [];
$str;
$str2;
$arr;
$arr2;
$lat;
$lng;
$f;
for ($i=0; $i<count($strings); $i++) {
$str = $strings[$i];
$str2 = '';
$arr = [];
$arr2 = [];
for ($j=0; $j<strlen($str); $j++) {
switch (substr($str, $j, 1)) {
case 'A': $str2 .= ',0'; break;
case 'B': $str2 .= ',1'; break;
case 'C': $str2 .= ',-1'; break;
case 'D': $str2 .= ',2'; break;
case 'E': $str2 .= ',-2'; break;
case 'F': $str2 .= ',3'; break;
case 'G': $str2 .= ',-3'; break;
case 'H': $str2 .= ',4'; break;
case 'I': $str2 .= ',-4'; break;
case 'J': $str2 .= ',5'; break;
case 'K': $str2 .= ',-5'; break;
case 'L': $str2 .= ',6'; break;
case 'M': $str2 .= ',-6'; break;
case 'N': $str2 .= ',7'; break;
case 'O': $str2 .= ',-7'; break;
case 'P': $str2 .= ',8'; break;
case 'Q': $str2 .= ',-8'; break;
case 'R': $str2 .= ',9'; break;
case 'S': $str2 .= ',-9'; break;
default: $str2 .= substr($str, $j, 1); }
}
for ($j=2; $j<count($arr); $j+=2) {
$lat += intval($arr[$j+1])/$f; }
}
return $myArray;
}
$output = Descompacta('1000I6575E3374BCBAACBABABABABBABBAABBBABBAABBABBDABAABBBABBAABBAABBABAABBBABBAABBBABBBBAABBAACBABCBABAABBABCBAACBCACB');
PD9waHAKCmZ1bmN0aW9uIERlc2NvbXBhY3RhKCRzdHJpbmcpIHsKCgkkbXlBcnJheSA9IFtdOwoJJHN0cjsgCgkkc3RyMjsgCgkkYXJyOwoJJGFycjI7CgkkbGF0OwoJJGxuZzsgCgkkZjsKCSRzdHJpbmdzID0gZXhwbG9kZSgiICIsJHN0cmluZyk7CgoJZm9yICgkaT0wOyAkaTxjb3VudCgkc3RyaW5ncyk7ICRpKyspIHsKCgkJJHN0ciA9ICRzdHJpbmdzWyRpXTsKCQkkc3RyMiA9ICcnOwoJCSRhcnIgPSBbXTsKCQkkYXJyMiA9IFtdOwoKCQlmb3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