The regular expression matching function was edited at 00:36:32 on by Jackdowson123.
Regular HTML
$ Data = mb_convert_encoding ($ data, "UTF-8", "gb2312 ");
Preg_match_all ('/\> (\-? \ D + \. \ d +) \ <\/font \>/', $ data, $ matches );
Return var_dump ($ matches );
$ Data ='
Dormitory power remaining query result
As of this morning, the power remaining in 22 416 bedroom buildings: 20.34 degrees.
(Query operation Execution time)
|
Note:
(1) normally, the electricity management system automatically reads data from AM to am every day, obtains the power consumption since am the previous day, and calculates the remaining power. if the remaining power is less than or equal to 0 degrees, the power supply stops waiting for the user to renew the electricity bill.
(2) after the electricity fee is paid off, the system generally supplies power 10 minutes later. |
Close
'
Why is a null value returned here, but if $ data = '100 °. ', 20. 34 can be returned. Does anyone know why?
Reply to discussion (solution)
Preg_match_all ('/\> (\-? \ D + \. \ d +) \ <\/font \>/I ', $ data, $ matches );
I case-insensitive
I am here to learn