开发者

Using Regex span id and get contents help

开发者 https://www.devze.com 2023-03-29 19:07 出处:网络
I nee开发者_高级运维d Regex this <span id=\"more-186483\"> Number 186483 is constantly changing, for each item is different.$html = file_get_contents(\"http://site.com/file.html\");

I nee开发者_高级运维d Regex this <span id="more-186483"> Number 186483 is constantly changing, for each item is different.


$html = file_get_contents("http://site.com/file.html");

preg_match_all('%<span id="more-.*?">(.*?)</span>%i', $html, $result, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($result[0]); $i++) {
    echo $result[1][$i];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消