Grab a page with a datasheet with curl, just get all the cells under TR and use the following method
$content = 内容;preg_match_all('/(.*?)<\/td>/',$content,$res);
But there are two things that can't be matched.
内容
And
未付
Don't know why cells with a lot of space and cells with class can't match? Because there is no regular, a pattern can be fully matched out of TD.
There is also a problem with two table on the page. One for various conditions to filter the data, a hold the data, how to match the data only the table?
Reply content:
Grab a page with a datasheet with curl, just get all the cells under TR and use the following method
$content = 内容;preg_match_all('/(.*?)<\/td>/',$content,$res);
But there are two things that can't be matched.
内容
And
未付
Don't know why cells with a lot of space and cells with class can't match? Because there is no regular, a pattern can be fully matched out of TD.
There is also a problem with two table on the page. One for various conditions to filter the data, a hold the data, how to match the data only the table?
The line break cannot be matched in single-line mode.
You can use
\s匹配任意的空白符\S匹配任意不是空白符的字符
Extrapolate, match TD with Class.
/
([\s\S]+?)<\/td>/
Match one of the table's, the same extrapolate Ah, first from all the contents of the table into an array.
/
([\s\S]+?)<\/table>/
Then see you want the first few, and then use the above regular match again not good.
Or that sentence, extrapolate Ah!
$pattern = "/
([\s\S]*?)<\/td>/";
I don't think so.