Syntax: int preg_match_all (string pattern, string subject, array matches, int [order]);
Return value: integer
Correspondence type: data processing
Description
This function uses the pattern rule to analyze the comparison string subject as a whole. The values returned from the comparison are placed in the array parameter matches and sorted by order. The value of 'order' can be PREG_PATTERN_ORDER or PREG_SET_ORDER. If there is no order value, the system automatically uses PREG_PATTERN_ORDER to place it in the order value. The return value is the number of matching results. if there is no or an error occurs, the return value is false.
Example
Example of PREG_PATTERN_ORDER
Preg_match_all ("| <[^>] +> (.*) ] +> | U "," a test ", $ out, PREG_PATTERN_ORDER );
Print $ out [0] [0]. ",". $ out [0] [1]. "\ n ";
Print $ out [1] [0]. ",". $ out [1] [1]. "\ n"
?>
The return value is
Example:, This is a test
Example:, this is a test
Example of PREG_SET_ORDER
Preg_match_all ("| <[^>] +> (.*) ] +> | U "," a test ", $ out, PREG_SET_ORDER );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service