Home  >  Article  >  Backend Development  >  正则婚配函数

正则婚配函数

WBOY
WBOYOriginal
2016-06-13 11:26:35642browse

正则匹配函数

本帖最后由 Jackdowson123 于 2013-06-22 00:36:32 编辑 $data=mb_convert_encoding($data, "utf-8", "gb2312");
    preg_match_all ( '/\>(\-?\d+\.\d+)\/', $data, $matches );
return var_dump($matches);



其中$data='

寝室电量剩余查询结果










截止今天上午9:00, 22栋416寝室电量剩余:20.34 度.



(查询操作执行时间: 2013-6-21 11:49)



说明:
     (1)正常情况下,用电管理系统每天上午9:00-9:30自动抄表,得到前一天上午9:00以来的用电量,并计算电量剩余,如果剩余电量小于等于0度,则会停止供电等待用户续交电费。
    (2)续交电费后,系统一般在10分钟后供电。





关 闭








'

为什么这里返回的是空值,而如果$data='20.34 度.',却可以返回20.34.有没有人知道什么原因啊
正则 HTML
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn