note 83977 added to function.str-split
| From: | vec | Date: | Sat, 21 Jun 2008 15:38:10 +0000 |
| Subject: | note 83977 added to function.str-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140641@lists.php.net to get a copy of this message | ||
the fastast way (that fits my needs) to replace str_split() in php 4 i found is this:
<?php
if(!function_exists('str_split')) {
function str_split($string, $split_length = 1) {
$array = explode("\r\n", chunk_split($string, $split_length));
array_pop($array);
return $array;
}
}
?>
i also tested the provided functions in the comments..
(the differences are 0.001 to 0.00001 sec)
----
Server IP: 92.43.200.200
Probable Submitter: 89.132.122.41
----
Manual Page -- http://www.php.net/manual/en/function.str-split.php
Edit -- https://master.php.net/note/edit/83977
Del: integrated -- https://master.php.net/note/delete/83977/integrated
Del: useless -- https://master.php.net/note/delete/83977/useless
Del: bad code -- https://master.php.net/note/delete/83977/bad+code
Del: spam -- https://master.php.net/note/delete/83977/spam
Del: non-english -- https://master.php.net/note/delete/83977/non-english
Del: in docs -- https://master.php.net/note/delete/83977/in+docs
Del: other reasons-- https://master.php.net/note/delete/83977
Reject -- https://master.php.net/note/reject/83977
Search -- https://master.php.net/manage/user-notes.php