Name

split

Synopsis

array split(string pattern, string string[, int limit])

Returns an array of strings formed by splitting string on boundaries formed by the regular expression pattern. If limit is specified, at most that many substrings will be returned; the last substring will contain the remainder of string.

If your split is such that you don’t need regular expressions, explode( ) performs a similar function and is much faster.

Get Programming PHP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.