preg_split
array preg_split(string pattern, string subject, [int limit], [int flags])
pattern | Regex pattern by which to split |
subject | Input string to split |
limit | Limits the number of results |
flags | Flags controlling the split process |
Splits the subject string along the boundaries defined by the specified regular expression pattern.
Returns:
Array containing the results of splitting
Description:
When it’s necessary to split a string with a dynamic expression rather than a fixed one, this function comes to the rescue. The basic underlying idea is the same as preg_match_all() except that, instead of returning matched pieces of the subject string, it returns an array of pieces that didn’t match the specified pattern .
The optional parameter ...
Get PHP Functions Essential Reference 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.