explode
explode — Split a string by a string.Description
explode( string $separator,Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string separator.
string $string,
int $limit = PHP_INT_MAX ): array
Parameters
separator
The boundary string.
string
The input string.
limit
If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string.
If the limit parameter is negative, all components except the last -limit are returned.
If the limit parameter is zero, then this is treated as 1.
Return Values
Returns an array of strings created by splitting the string parameter on boundaries formed by the separator. If separator is an empty string (""), explode() will return false. If separator contains a value that is not contained in string and a negative limit is used, then an empty array will be returned, otherwise an array containing string will be returned. If separator values appear at the start or end of string, said values will be added as an empty array value either in the first or last position of the returned array respectively.More information about explode on official PHP documentation site
explode - Popular snippets
- PHP 8.1 / MySQL 5.7 explode strrev
last run:
2022-10-17 20:52:32
17
- PHP 7.4 / MySQL 8.0 mysqli_query mysqli_fetch_assoc explode count array_push trim array_count_values array_keys print_r
last run:
2023-06-06 16:46:02
15
- PHP 7.4 / MySQL 5.7 array_map explode var_dump
last run:
2023-02-09 19:13:23
11
- PHP 8.1 / MySQL 5.7 shuffle explode
last run:
2023-01-11 12:31:54
11
- PHP 8.0 / MySQL 5.7 explode preg_match substr strpos
last run:
2022-02-11 21:10:03
11
- PHP 8.1 / MySQL 5.7 shuffle explode
last run:
2023-01-11 12:22:51
10
- PHP 8.0 / MySQL 5.7 array_map explode array_shift implode array_keys array_combine array_values var_export
last run:
2023-07-25 23:19:25
9
- PHP 8.2.13 / MariaDB 10 array_diff explode print_r microtime
last run:
2024-04-06 15:39:50
8
- PHP 8.1 / MySQL 8.0 explode implode array_fill count mysqli_prepare
last run:
2024-02-29 07:50:31
8
- PHP 8.0 / PostgreSQL 13 explode var_dump
last run:
2023-11-04 19:53:40
8
explode - New snippets
-
PHP 8.1 / MySQL 5.7 explode print_r
added at:
2024-05-06 12:43:50
1
-
PHP 8.1 / MySQL 5.7 explode print_r
added at:
2024-05-06 12:43:38
1
-
PHP 8.1 / MySQL 5.7 explode var_dump strlen count print_r
added at:
2024-05-06 06:45:07
1
-
PHP 8.1 / MySQL 5.7 explode var_dump count print_r
added at:
2024-05-06 06:44:52
1
-
PHP 8.1 / MySQL 5.7 explode var_dump count print_r
added at:
2024-05-06 06:44:44
1
-
PHP 8.1 / MySQL 5.7 var_dump explode count print_r
added at:
2024-05-06 06:42:42
1
-
PHP 8.1 / MySQL 5.7 var_dump explode count print_r
added at:
2024-05-06 06:42:16
1
-
PHP 8.1 / MySQL 5.7 var_dump explode count print_r
added at:
2024-05-06 06:42:10
1
-
PHP 8.1 / MySQL 5.7 array_reduce explode trim array_push print_r
added at:
2024-05-04 08:07:11
1
-
PHP 8.1 / MySQL 5.7 array_reduce explode trim array_push print_r
added at:
2024-05-04 08:07:02
1