看板
[ RegExp ]
討論串[問題] 匹配多行
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
<?php. $text = '<text>. 這是第一行. 這是第二行. 這是第三行. </text>';. preg_match_all('@<text>([.\n]+)</text>@',$text,$result,PREG_SET_ORDER);. echo $result[0][1];.
(還有78個字)
內容預覽:
參考:. http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php. 添加 modifier: s (PCRE_DOTALL), i (PCRE_CASELESS). 得到:. '/<text>(.*?)<\/text>/is
(還有17個字)
首頁
上一頁
1
下一頁
尾頁