← All built-ins / str_split()
str_split()
str_split(...$args): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $s | string | string to cut |
| $len | int | chunk length (default 1)optional |
Return value
Array of chunks.
Example
echo implode("|", str_split("abc")), "
";
echo implode("|", str_split("abcdef", 2)), "
";a|b|c ab|cd|ef