Now want to open a text document with the content:
March 17, the daily turnover of 88471, an increase of 9511 yoy .....
Need to be 88471 after the turnover of the assigned value to $now, the year-on intercept to assign value to $bizhi, how to deal with it?
Reply to discussion (solution)
$s = ' March 17, daily turnover 88471, increase 9511, ... ';p reg_match_all ('/(\d+),/', $s, $r), List ($now, $bizhi) = $r [1];echo $now;/ 88471echo $bizhi;//9511
There was also a problem during the commissioning process
$file _name= "data.txt"; $s =file_get_contents ($file _name);
Data.txt inside is the content of the string, how to output is blank?
If your page is Utf-8, and the data.txt content is GBK
Then the output is blank .
So how can I handle this txt text? Automatically converted to GBK? All my pages are encoded in gb2312.
Your code for the relevant
Coding to be consistent
Open file Save a copy of Utf-8 encoded