update : 2015.11.03
php.shukuma.com검색:
|
split(PHP 4, PHP 5) split — Split string into array by regular expression 설명
array split
( string
$pattern
, string $string
[, int $limit = -1
] )
Splits a Warning
이 함수는 PHP 5.3.0부터 배제됩니다. 이 기능에 의존하지 않기를 권합니다. 인수
반환값
Returns an array of strings, each of which is a substring of
If there are n occurrences of
예제
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 주의
Tip
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(). 참고
|