gpt4 book ai didi

php - 正则表达式的 html

转载 作者:太空狗 更新时间:2023-10-29 13:39:18 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
RegEx match open tags except XHTML self-contained tags

我有以下字符串:

$str = " 
<li>r</li>
<li>a</li>
<li>n</li>
<li>d</li>
...
<li>om</li>
";

如何获取第 n 个 <li> 的 HTML标签?

Ex : n = 3 ; result = "<li>r<...>n</li>;

如果可能的话,我想要一个正则表达式。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com