note 24525 deleted from function.split by jmcastagnetto

From: Date: Tue, 20 Aug 2002 22:32:30 +0000
Subject: note 24525 deleted from function.split by jmcastagnetto
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-35272@lists.php.net to get a copy of this message
it seems that split() does not split a null-separated string. neither does preg_split(), but explode() does. Eg. <? $str = "a\0b\0c"; print "Using split"; print_r(split("\0",$str)); print "<hr>Using preg_split"; print_r(preg_split("/\0/",$str)); print "<hr>Using explode"; print_r(explode("\0",$str)); ?> will produce the desired array (a,b,c) only with explode. Is this a bug or am I missing a doc. somewhere?

« previous php.notes (#35272) next »