Copy codeThe Code is as follows:
/*
1 (? S) indicates Pattern. DOTALL, that is, match the line feed, allowing the img to appear in multiple lines
2 .*? Indicates that non-greedy matches any character until the following conditions appear.
3? : Indicates that the match is not captured, that is, [\. gif | \. jpg] does not appear in the result.
*/
$ Pattern = "/ /";
$ Str = '<p style = "padding: 0px; margin-top: 0px; margin-bottom: 0px; line-height: 200%; "> </p> <p style =" padding: 0px; margin-top: 0px; margin-bottom: 0px; line-height: 200%; "> </p> <p style =" padding: 0px; margin-top: 0px; margin-bottom: 0px; line-height: 200%; "> </p> ';
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
)
)
*/