array( 'header' => "\n\n", 'footer' => "", 'row' => "{description}\n" ), 'kml' => array( 'header' => "\n\n\n", 'footer' => "\n", 'row' => "{description}{lon},{lat}\n" ) ); $y = ''; $type = $_REQUEST['format']; if(isset($_REQUEST['chattxt'])) { $y = $txt[$type]['header']; $a = preg_split('/\s+\[([01]\d|2[0-3]):([0-5]\d):([0-5]\d)\]\s+/', $_REQUEST['chattxt']); foreach($a as $line) { if(!preg_match('/[^\s]*lat=(-?\d+(.\d+))[^\s]+lon=(-?\d+(.\d+))[^\s]*/',$line,$m)) { continue; } if(abs(intval($m[1])) > 90 || abs(intval($m[3])) > 180) { continue; } $descr = trim(preg_replace('/[^\s]*lat=-?\d+(.\d+)[^\s]+lon=-?\d+(.\d+)[^\s]*/m','', $line)); $y .= str_replace( array('{description}','{lat}','{lon}'), array($descr, $m[1], $m[3]), $txt[$type]['row'] ); } $y .= $txt[$type]['footer']; } if(isset($_REQUEST['download'])) { header("Content-Disposition: attachment; filename=\"".date('YmdHis').".".$type."\""); header("Content-Type: text/plain"); echo $y; exit; } ?> Skype osmand links to map


GPX & KML visualizer | Source

'.htmlspecialchars($y).''; ?>