note 97476 deleted from function.explode by cmb
| From: | cmb@php.net | Date: | Tue, 19 May 2015 14:16:35 +0000 |
| Subject: | note 97476 deleted from function.explode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-202606@lists.php.net to get a copy of this message | ||
Note Submitter: drieick at hotmail dot com
----
When explode is given an empty $string, it'll return an array with a single empty element.
<?php
# returns Array([0] => );
print_r(explode(',', ''));
?>
This is not a bug, but it can be pretty tricky (especially with callbacks that expect a certain type
of array). So, be sure to check your arrays. It's not a bug, because there's nothing to
split.