preg_match_all

preg_match_all -- Perform a global regular expression match

Description

int preg_match_all ( string pattern, string subject, array matches [, int flags])

PREG_PATTERN_ORDER







So, $out[0] contains array of strings that matched full pattern, and $out[1] contains array of strings enclosed by tags.



PREG_SET_ORDER

This example will produce: In this case, $matches[0] is the first set of matches, and $matches[0][0] has text matched by full pattern, $matches[0][1] has text matched by first subpattern and so on. Similarly, $matches[1] is the second set of matches, etc.

PREG_OFFSET_CAPTURE



Příklad 1 .






Příklad 2 .












This example will produce: