note 74657 deleted from function.explode by tularis
| From: | tularis@php.net | Date: | Mon, 27 Oct 2008 13:06:45 +0000 |
| Subject: | note 74657 deleted from function.explode by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145825@lists.php.net to get a copy of this message | ||
Note Submitter: Q1712 at online dot ms
----
some more notes on the delimiter:
if the delimiter is 0, explode will return an array with one element containig the hole string (same
as if the delimiter was 1).
if a negative delimiter is bigger or equal to the number of components, an empty array is returned.
<?php
print_r( explode( "|", "one|two|three|four", 0) );
print_r( explode( "|", "one|two|three|four", 1) );
?>
both print:
Array
(
[0] => one|two|tree|four
)
<?php
print_r( explode( "|", "one|two|three|four", -4) );
print_r( explode( "|", "one|two|three|four", -5) );
?>
both print:
Array
(
)