note 109343 added to function.explode
| From: | php dot net at pravec dot de | Date: | Sun, 08 Jul 2012 22:13:59 +0000 |
| Subject: | note 109343 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189070@lists.php.net to get a copy of this message | ||
there is a difference how active server pages (vbs/asp) handle array. an empty string will return
nothing after split. while translating asp to php ... take this:
$a = explode("\r\n", "");
print(count($a));
$b = ms_explode("\r\n", "");
print(count($b));
function ms_explode($delimiter, $string, $limit = 0xFFFFFFFF)
{
return($string ? explode($delimiter, $string, $limit) : array());
}
----
Server IP: 69.147.83.197
Probable Submitter: 146.60.132.25
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit -- https://master.php.net/note/edit/109343
Del: integrated -- https://master.php.net/note/delete/109343/integrated
Del: useless -- https://master.php.net/note/delete/109343/useless
Del: bad code -- https://master.php.net/note/delete/109343/bad+code
Del: spam -- https://master.php.net/note/delete/109343/spam
Del: non-english -- https://master.php.net/note/delete/109343/non-english
Del: in docs -- https://master.php.net/note/delete/109343/in+docs
Del: other reasons-- https://master.php.net/note/delete/109343
Reject -- https://master.php.net/note/reject/109343
Search -- https://master.php.net/manage/user-notes.php