Copy CodeThe code is as follows:
/*
1 (? s) represents Pattern.dotall, which is the matching newline, allowing the IMG to appear in multiple lines
2. * represents non-greedy matches any character until a later condition occurs
3: Represents this match but is not captured, that is, the result does not appear [\.gif|\.jpg] or meaning
*/
$pattern = "//";
$str = '
';
Preg_match_all ($pattern, $str, $match);
Print_r ($match);
/*
Array
(
[0] = = Array
(
[0] = =
[1] = =
[2] = =
)
[1] = = Array
(
[0] = upfiles/2009/07/1246430143_4.jpg
[1] = Upfiles/2009/07/1246430143_3.jpg
[2] = Upfiles/2009/07/1246430143_1.jpg
)
)
*/
http://www.bkjia.com/PHPjc/321480.html www.bkjia.com true http://www.bkjia.com/PHPjc/321480.html techarticle Copy the code as follows:/* 1 (? s) on behalf of Pattern.dotall, that is, match line break, allow IMG to appear in multiple lines 2. *? represents non-greedy matches any character until a later condition occurs ...