Quoted from here:
If delimiter contains a value that is
not contained in string and a negative
limit is used, then an empty array
will be returned, otherwise an array
containing string will be returned.
But why I still don’t get an empty array?
var_dump(explode(',', '', -1))
I get this:
array(1) {
[0]=>
string(0) ""
}
UPDATE
Try it in windows,with PHP 5.2.8 (cli) (built: Dec 8 2008 19:31:23)
I can confirm that this doesn’t work in
PHP 5.2.8.It does work in
PHP 5.2.11. In my opinion, there are many bugs in the 5.2 branch, so try always to use the latest version. 5.3 is more stable in my experience.