日期:2014-05-16 浏览次数:20647 次
$str = 'tmap 116.123456,39.123456';
preg_match_all('/[^\s]+/', $str, $match);
$numstr = $match[0][1];
print_r(explode(',',$numstr));
$s = 'tmap 116.123456,39.123456';
preg_match_all('/[\d.]+/', $s, $r);
print_r($r[0]);
Array
(
[0] => 116.123456
[1] => 39.123456
)
$s='tmap 116.123456,39.123456';
$ar = preg_split('/[\s,]+/',$s);
print_r($ar);
$str = 'tmap 116.123456,39.123456';
print_r(preg_split('/[\s,]/', $str));