← All built-ins / preg_split()
preg_split()
preg_split(...$args): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $pattern | string | /…/ pattern acting as delimiter |
| $subject | string | string to split |
Return value
Array of the pieces between matches.
Example
$p = preg_split("/[,:]+/", "a,b:c,,d");
echo implode("|", $p);a|b|c|d