我有這樣的BBCode。如何從bbcode中提取完整的圖像?
[IMG]art_74e7e4f8811380426577.jpeg[/IMG] [IMG]art_74e7e4f8811380426595.jpeg[TITLE]title is always needy[/TITLE][/IMG]
我需要提取兩個圖像。所以我preg_match_all是:
preg_match_all('/\[IMG\][^(\[\/IMG\])]+/', $body, $matches);
,給了我這樣的:
[0] => [IMG]art_74e7e4f8811380426577.jpeg
[1] => [IMG]art_74e7e4f8811380426595.jpeg
我需要包括標題標籤進入第二occurence。很堅持...