note 84891 added to function.str-split
| From: | rrelmy at osu1 dot php dot net | Date: | Mon, 04 Aug 2008 14:20:55 +0000 |
| Subject: | note 84891 added to function.str-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143133@lists.php.net to get a copy of this message | ||
revised function from tatsudoshi
Fixed some bugs, more php5 style compliant
<?php
if(!function_exists('str_split')) {
function str_split($string,$string_length=1) {
if(strlen($string)>$string_length || !$string_length) {
do {
$c = strlen($string);
$parts[] = substr($string,0,$string_length);
$string = substr($string,$string_length);
} while($string !== false);
} else {
$parts = array($string);
}
return $parts;
}
}
?>
----
Server IP: 194.153.94.10
Probable Submitter: 195.141.222.11
----
Manual Page -- http://www.php.net/manual/en/function.str-split.php
Edit -- https://master.php.net/note/edit/84891
Del: integrated -- https://master.php.net/note/delete/84891/integrated
Del: useless -- https://master.php.net/note/delete/84891/useless
Del: bad code -- https://master.php.net/note/delete/84891/bad+code
Del: spam -- https://master.php.net/note/delete/84891/spam
Del: non-english -- https://master.php.net/note/delete/84891/non-english
Del: in docs -- https://master.php.net/note/delete/84891/in+docs
Del: other reasons-- https://master.php.net/note/delete/84891
Reject -- https://master.php.net/note/reject/84891
Search -- https://master.php.net/manage/user-notes.php