Jump to content

multi <div></div> tags matching


mike42

Recommended Posts

preg_match_all("/<div[^>]*>(.*?)<\/div>/",$string,$matches);

 

 

[pre]

Array

(

  [0] => Array

      (

        [0] => <div> some text1</div>

        [1] => <div>sometxt2</div>

        [2] => <div>example</div>

      )

  [1] => Array

      (

        [0] =>  some text1

        [1] => sometxt2

        [2] => example

      )

)

[pre]

Link to comment
https://forums.phpfreaks.com/topic/134197-multi-tags-matching/#findComment-698730
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.