求帮:php怎么用正则获取浮点数? $str = 'tmap 116.123456,39.123456';preg_match_all('/[^\s]+/', $str, $match);$numstr = $match[0][1];print_r(explode(',',$numstr));Array( [0] => 116.123456 [1] => 39.123456) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $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)); session destroy的问题。 怎样得到没有..的路径 为何看着一样的字符串用strcmp比较结果是不等呢? 请大家帮帮忙~ 学习mysql存储过程 被挡在门口了…… txt写入问题 XP下配好了apache,用firefox可以访问,用IE却不能访问 取不到当前正确日期问题 PHP下拉列表框可以自己输入也可选择的问题 php如何禁止页面缓存? win8系统,cmd登陆mysql,mysql找不到? php PHP数组操作问题
preg_match_all('/[\d.]+/', $s, $r);
print_r($r[0]);Array
(
[0] => 116.123456
[1] => 39.123456
)
$ar = preg_split('/[\s,]+/',$s);
print_r($ar);
print_r(preg_split('/[\s,]/', $str));