PHP - regular expression
$html = '
<网页数据>
';
$RegExp='/(.*?)/s';
//取得第一个tbody
$k=preg_match_all($RegExp,$html,$result);
$tbody = $result[1][0];
//取得字段名称
$RegExp='/(.*?)/s';
$k=preg_match_all($RegExp,$tbody,$result);
$params = $result[1];
foreach($params as $param) {
echo $param;
}
This is what I used to catch the interception of data pages down, and made the first tbody table of contents, the first field name and content caught out
Use this $ result will be an array, the first array is the result of the original string array, the array and the second is (. *?) Taken out of the text array.
Original: Big Box PHP - RegExp - regular expression