preg_match_all
preg_match_all — Perform a global regular expression match.Description
preg_match_all( string $pattern,Searches subject for all matches to the regular expression given in pattern and puts them in matches in the order specified by flags. After the first match is found, the subsequent searches are continued on from end of the last match.
string $subject,
array &$matches = null,
int $flags = 0,
int $offset = 0 ): int|false|null
Parameters
pattern
The pattern to search for, as a string.
subject
The input string.
matches
Array of all matches in multi-dimensional array ordered according to flags.
flags
flags can be a combination of the following flags: PREG_PATTERN_ORDER, PREG_SET_ORDER, PREG_OFFSET_CAPTURE, PREG_UNMATCHED_AS_NULL
offset
Normally, the search starts from the beginning of the subject string. The optional parameter offset can be used to specify the alternate place from which to start the search (in bytes).
Return Values
preg_match() returns 1 if the pattern matches given subject, 0 if it does not, or false if an error occurred.More information about preg_match_all on official PHP documentation site
preg_match_all - Popular snippets
- PHP 8.1 / MySQL 5.7 base64_decode preg_match_all count str_replace chr hexdec preg_match
last run:
2023-11-12 20:14:19
17
- PHP 8.0 / MySQL 5.7 preg_match_all print_r
last run:
2024-11-05 19:18:35
13
- PHP 7.4 / MySQL 5.7 preg_match_all
last run:
2021-04-10 15:10:58
13
- PHP 8.0 / MySQL 5.7 trim preg_match_all mt_srand mt_rand count strtoupper substr_replace
last run:
2024-03-10 14:50:03
12
- PHP 8.1 / MySQL 5.7 preg_match_all preg_replace
last run:
2022-05-26 14:12:50
11
- PHP 8.1 / MySQL 5.7 file_exists file_get_contents preg_match_all parse_url rtrim
last run:
2022-07-12 14:01:54
10
- PHP 8.1 / MySQL 5.7 preg_match_all end
last run:
2023-09-25 16:37:10
9
- PHP 8.0 / MySQL 5.7 preg_match_all in_array array_pop
last run:
2021-05-08 14:32:11
9
- PHP 8.1 / MySQL 5.7 preg_match_all print_r
last run:
2024-04-16 14:59:07
8
- PHP 8.1 / MySQL 5.7 preg_match_all str_replace print_r
last run:
2023-09-15 12:31:34
7
preg_match_all - New snippets
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r implode
added at:
2024-11-05 19:26:49
2
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:22:35
4
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:22:21
3
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:21:05
1
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:20:36
4
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:17:09
2
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:17:05
2
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:16:07
13
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:15:57
4
-
PHP 8.0 / MySQL 5.7 preg_match_all print_r
added at:
2024-11-05 19:15:37
3