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.3 / MySQL 5.7 md5 explode substr
last run:
2023-06-15 08:30:51
8
- PHP 8.1 / MySQL 5.7 explode count
last run:
2023-04-07 20:29:31
8
- PHP 8.1 / MySQL 5.7 shuffle explode
last run:
2023-01-11 12:28:57
8
explode - New snippets
-
PHP 8.1 / MySQL 5.7 explode
added at:
2023-09-22 09:41:30
1
-
PHP 8.1 / MySQL 5.7 explode
added at:
2023-09-22 09:41:22
1
-
PHP 8.1 / MySQL 5.7 explode intval floatval
added at:
2023-09-22 09:40:54
1
-
PHP 8.1 / MySQL 5.7 explode intval floatval
added at:
2023-09-22 09:40:47
1
-
PHP 8.1 / MySQL 5.7 explode array_map implode trim
added at:
2023-09-21 06:28:02
1
-
PHP 8.1 / MySQL 5.7 explode array_map implode trim
added at:
2023-09-21 06:27:45
1
-
PHP 8.1 / MySQL 5.7 explode array_map implode trim
added at:
2023-09-21 06:27:15
1
-
PHP 8.1 / MySQL 5.7 explode array_map implode trim
added at:
2023-09-21 06:27:00
1
-
PHP 8.1 / MySQL 5.7 explode array_map implode trim
added at:
2023-09-21 06:26:50
1
-
PHP 8.1 / MySQL 5.7 explode array_map implode var_dump trim
added at:
2023-09-21 06:26:14
1