私はpreg_match_allを使用する簡単なphpの例を持っています
$str = "
Line 1: This is a string
Line 2: [img] image_path [/img] Should not be [img] image_path2 [/img] included.
Line 3: End of test [img] image_path3 [/img] string.";
preg_match_all("~\[img](.+)\[/img]~i", $str, $m);
var_dump($m);
そして私はそれが戻ってくることを望みます
array(
[0] =>image_path
[1] =>image_path2
[2] =>image_path3
)
何らかの理由で、この結果が得られません。
アリのアイデア?