Copy code The code is as follows:
/*
1 (?s) represents Pattern.DOTALL, which means matching newlines, allowing
2 .*? appearing in multiple lines in img means non-greedy matching of any character until the subsequent condition appears
3 ?: means this match but is not captured, that is, it does not appear in the result [.gif|.jpg ] means or
*/
$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.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321480.htmlTechArticleCopy the code as follows: /* 1 (?s) represents Pattern.DOTALL, which matches newlines and allows img appears in multiple lines 2.*? means non-greedy matching of any character until the following condition appears...