PHP » GoLang |
login |
register |
about
|
split(PHP 4, PHP 5) split — Split string into array by regular expression Warning
This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0. Alternatives to this function include: Description
array split
( string
$pattern
, string $string
[, int $limit = -1
] )
Splits a Parameters
Return Values
Returns an array of strings, each of which is a substring of
If there are n occurrences of
Examples
Example #1 split() example To split off the first four fields from a line from /etc/passwd:
<?php
Example #2 split() example To parse a date which may be delimited with slashes, dots, or hyphens:
<?php NotesTip
split() is deprecated as of PHP 5.3.0. preg_split() is the suggested alternative to this function. If you don't require the power of regular expressions, it is faster to use explode(), which doesn't incur the overhead of the regular expression engine. Tip
For users looking for a way to emulate Perl's @chars = split('', $str) behaviour, please see the examples for preg_split() or str_split(). See Also
|
more
Recently updated
more
Most requested
|