关于preg_match_all的抓取
<div><br />
<h1>标题1</h1><br />
<p>内容1</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/1319">
<img src="https://img.php.cn/upload/ai_manual/000/000/000/175680201295703.jpg" alt="AI Undetect">
</a>
<div class="aritcle_card_info">
<a href="/ai/1319">AI Undetect</a>
<p>让AI无法察觉,让文字更人性化,为文字体验创造无限可能。</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="AI Undetect">
<span>162</span>
</div>
</div>
<a href="/ai/1319" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="AI Undetect">
</a>
</div>
<br />
<p>内容2</p><br />
<h1>标题2</h1><br />
<p>内容1</p><br />
<p>内容2</p><br />
<p>内容3</p><br />
<p>内容4</p><br />
<h1>标题3</h1><br />
<p>内容1</p><br />
<p>内容2</p><br />
<p>内容3</p><br />
</div>内容1
内容2
内容1
内容2
内容3
内容4
内容1
内容2
内容3
preg_match_all('/<h1>[\w\W]*<(h1|\/div)/U',$html, $out)preg_match_all('/<div>(.*)<\/div>/is', $str, $m);<br />
$m = explode('<h1>', substr($m[1][0], 5));<br />
foreach($m as $x)<br />
echo htmlspecialchars ("<h1>$x") . '<br/>';
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号