note 86755 added to function.str-split

From: Date: Sun, 02 Nov 2008 11:26:40 +0000
Subject: note 86755 added to function.str-split
Groups: php.notes 
Request: Send a blank email to php-notes+get-146037@lists.php.net to get a copy of this message
My implementation of str_split(): <?php function __strlen($string){ $i=0; while(isset($string[$i])) $i++; return $i; } function __str_split($string, $split_lenght=0){ for($array=array(),$j=0,$i=0; $i<__strlen($string); $i++){ $array[$j] .= $string[$i]; if(__strlen($array[$j]) >= $split_lenght) $j++; } return $array; } print_r(__str_split("ciao amici",3)); ?> ---- Server IP: 213.92.11.19 Probable Submitter: 151.53.48.127 ---- Manual Page -- http://www.php.net/manual/en/function.str-split.php Edit -- https://master.php.net/note/edit/86755 Del: integrated -- https://master.php.net/note/delete/86755/integrated Del: useless -- https://master.php.net/note/delete/86755/useless Del: bad code -- https://master.php.net/note/delete/86755/bad+code Del: spam -- https://master.php.net/note/delete/86755/spam Del: non-english -- https://master.php.net/note/delete/86755/non-english Del: in docs -- https://master.php.net/note/delete/86755/in+docs Del: other reasons-- https://master.php.net/note/delete/86755 Reject -- https://master.php.net/note/reject/86755 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146037) next »