First, we will introduce this function: int & amp; nbsp; preg_match_all & amp; nbsp; (& amp; nbsp; string & amp; nbsp; pattern, & amp; nbsp; string & amp; nbsp; subject, & amp; nbsp;
First, we will introduce this function:
Int preg_match_all (string pattern, string subject, array matches [, int flags]) executes a global regular expression match.
Search all the content that matches the regular expression given by pattern in the subject and put the result in the matches in the order specified by flags.
After the first match is found, the next search starts from the end of the previous match.
Flags can be a combination of the following tags (note that it is meaningless to combine PREG_PATTERN_ORDER and PREG_SET_ORDER ):
PREG_PATTERN_ORDER sorts the results so that $ matches [0] is an array of all pattern matching, $ matches [1] is an array consisting of strings matching the child pattern in the first bracket, and so on!
Let's take a look at the following php instance:
/";preg_match_all($pattern,$con,$match); print_r($match);?>
The execution result is:
Array
(
[0] => Array
(
[0] =>
[1] =>
[2] =>
)
[1] => Array
(
Http://www.phpddt.com/usr/themes/dddefault/images/logo.png
Http://www.phpddt.com/usr/uploads/2012/09/531656480.jpg
Http://www.phpddt.com/usr/uploads/2012/09/2647136297.jpg
)
)