How to use php to quickly match pictures in articles
This article mainly introduces "how to use php to quickly match the pictures in the article". In the daily operation, I believe that many people have doubts about how to use php to quickly match the pictures in the article. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to use php to quickly match the pictures in the article." Next, please follow the editor to study!
Preg_match_all function:
Int preg_match_all (string pattern, string subject, array matches [, int flags])
Perform a global regular expression match
Search subject for everything that matches the regular expression given by pattern and put the results into matches in the order specified by flags.
After the first match is searched, the next search starts at the end of the previous match.
Flags can be a combination of the following tags (note that it doesn't make sense to combine PREG_PATTERN_ORDER and PREG_SET_ORDER):
PREG_PATTERN_ORDER sorts the results so that $matches [0] is an array of all patterns, $matches [1] is an array of strings matched by the subpatterns in the first parenthesis, and so on!
$pattern= "/