note 27463 added to function.preg-split
| From: | jj02 at operamail dot com | Date: | Fri, 06 Dec 2002 16:37:41 +0000 |
| Subject: | note 27463 added to function.preg-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40430@lists.php.net to get a copy of this message | ||
function my_split($delim, $string) {
# returns null instead of array if string is empty
if (strlen($string) == 0) { return NULL; }
# splits and trims each of the substrings
return preg_split("/\s*$delim\s*/", trim($string));
}
--
http://www.php.net/manual/en/function.preg-split.php
http://master.php.net/manage/user-notes.php?action=edit+27463
http://master.php.net/manage/user-notes.php?action=delete+27463
http://master.php.net/manage/user-notes.php?action=reject+27463