开发者

preg_match_all no results

开发者 https://www.devze.com 2023-03-10 21:56 出处:网络
preg_match_all(\'|<tr>(.*?)</tr>|\', \'<table> <tr> <td>oo</td> </开发者_Python百科tr>
    preg_match_all('|<tr>(.*?)</tr>|', '<table>
<tr>
<td>oo</td>
</开发者_Python百科tr>
<tr>
<td>ddd</td>
</tr>
</table>', $matches, PREG_PATTERN_ORDER);

why this doesn't show any results. I want to get second match $matches[1][2]


You need to use the s pattern modifier

preg_match_all('|<tr>(.*?)</tr>|s', ...

0

精彩评论

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