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 5.6 / MySQL 5.7 preg_match_all count var_export pathinfo
last run:
2024-11-22 08:46:23
7
preg_match_all - New snippets
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower print_r
added at:
2024-12-17 07:48:07
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower print_r
added at:
2024-12-17 07:47:25
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower print_r
added at:
2024-12-17 07:46:48
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower print_r
added at:
2024-12-17 07:45:40
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower
added at:
2024-12-17 07:45:30
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower
added at:
2024-12-17 07:45:20
2
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower
added at:
2024-12-17 07:45:05
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower
added at:
2024-12-17 07:44:39
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower
added at:
2024-12-17 07:44:33
1
-
PHP 8.1 / MySQL 5.7 preg_match_all array_filter in_array strtolower
added at:
2024-12-17 07:44:23
1