note 125805 added to function.explode

From: Date: Wed, 10 Feb 2021 21:42:58 +0000
Subject: note 125805 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-219255@lists.php.net to get a copy of this message
Be careful, while most non-alphanumeric data types as input strings return an array with an empty string when used with a valid separator, true returns an array with the string "1"! var_dump(explode(',', null)); //array(1) { [0]=> string(0) "" } var_dump(explode(',', false)); //array(1) { [0]=> string(0) "" } var_dump(explode(',', true)); //array(1) { [0]=> string(1) "1" } ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.159.166 (proxied: 74.98.206.186) ---- Manual Page -- http://php.net/manual/en/function.explode.php Edit -- https://master.php.net/note/edit/125805 Del: integrated -- https://master.php.net/note/delete/125805/integrated Del: useless -- https://master.php.net/note/delete/125805/useless Del: bad code -- https://master.php.net/note/delete/125805/bad+code Del: spam -- https://master.php.net/note/delete/125805/spam Del: non-english -- https://master.php.net/note/delete/125805/non-english Del: in docs -- https://master.php.net/note/delete/125805/in+docs Del: other reasons-- https://master.php.net/note/delete/125805 Reject -- https://master.php.net/note/reject/125805 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#219255) next »