note 90415 deleted from function.explode by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:49:14 +0000 |
| Subject: | note 90415 deleted from function.explode by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215328@lists.php.net to get a copy of this message | ||
Note Submitter: SR
----
Keep in mind that explode() can return empty elements if the delimiter is immediately repeated twice
(or more), as shown by the following example:
<?php
$foo = 'uno dos tres'; // two spaces between "dos" and "tres"
print_r(explode(' ', $foo));
?>
Array
(
[0] => uno
[1] => dos
[2] =>
[3] => tres
)
Needless to say this is definitely not intuitive and must be handled carefully.