split

Splits the string with the provided regular expression.

Description

static[] split(string $pattern, int|null $limit, bool $quote = 1)

Parameters

  • string $pattern
    The regex with which to split the string.

  • int|null $limit
    Optional maximum number of results to return.

  • bool $quote
    By default this method will run the provided $pattern through preg_quote(), this allows the method to be used to split on simple substrings.

Return Value

static[]
An array of Str objects.