求帮: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)); 数据同步 php 编码 \u54AC 怎样把excel内的数据导入到mysql数据库? php操作word,excel,具体怎么操作呀? 传入参数的问题 类方法中使用array_map报错--- Cannot redeclare 请问为什么上传路径有误??解决后立即结帖 bbs上发的大家图片怎么管理的? 1.两段<html></html>有什么意思? 刚开始接触php为啥启动页面就报错 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));