Split a string by a string.
Twine\Str::explode( string $delimiter [ , int $limit = PHP_INT_MAX ] ) : array
$delimiter | The boundary string |
$limit |
The maximum number of elements in the exploded array.
|
$string = new Twine\Str('john pinkerton');
$string->explode(' '); // Returns ['john', 'pinkerton']
$string = new Twine\Str('john maurice mcclean pinkerton');
$string->explode(' ', 3); // Returns ['john', 'maurice', 'mcclean pinkerton']