ID: 30095 Updated by: [EMAIL PROTECTED] Reported By: billmarrs at gmail dot com -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Linux PHP Version: 5.0.0 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php When you explode a string even if the separator string was not found the output will still be an array. This array will contain a single element, which will contain the entire string. This is '' in your case. Previous Comments: ------------------------------------------------------------------------ [2004-09-15 16:42:03] billmarrs at gmail dot com Description: ------------ explode on an empty string creates an array with a single blank element, instead of an empty array (with no elements). This means that explode/implode do not yield reversible results when an empty array is used (though, they do otherwise -- when the array is non-empty). This is a duplicate of #699, but I'm resubmitting since #699 was closed with no explanation a long time ago. Reproduce code: --------------- $a = array(); $b = explode(":", implode(":", $a)); print "a: "; print_r($a); print "<p>b: "; print_r($b); Expected result: ---------------- a: Array ( ) b: Array ( ) Actual result: -------------- a: Array ( ) b: Array ( [0] => ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30095&edit=1