Matching a multiple lines pattern via PHP's preg_match()

后端 未结 6 850
轻奢々
轻奢々 2020-12-10 00:33

How can I match subject via a PHP preg_match() regular expression pattern in this HTML code:

      
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 01:10

    You can add the m operator to your regular expression:

    // Given your HTML content.
    $html = 'Your HTML content';
    preg_match('/]*>(.*?)<\/td>/im', $html, $matches);
    

    Hope this (still) helps, hahaha.

提交回复
热议问题