PHP kôd:
$string = 'crapblabalhaml,ah.1.12345f.ls.d100.10.i.aCRA18.11560PBL44.843948HAlololol';
preg_match_all('#(([0-9]+){1,3}\.([0-9]+))#is', $string, $matches);
print_r($matches[1]);
Citat:
Array ( [0] => 1.12345 [1] => 100.10 [2] => 18.11560 [3] => 44.843948 )
|
A napraviš fino funkciju...
PHP kôd:
$string = 'crapblabalhaml,ah.1.12345f.ls.d100.10.i.aCRA18.11560PBL44.843948HAlololol';
function extract_ll($string)
{
if(preg_match_all('#(([0-9]+){1,3}\.([0-9]+))#is', $string, $matches)) return $matches[1];
return false;
}
var_dump(extract_ll($string));
Ograniči na 2 koordinate ili šta već... snađi se