note 84213 added to function.str-split

From: Date: Thu, 03 Jul 2008 15:44:30 +0000
Subject: note 84213 added to function.str-split
Groups: php.notes 
Request: Send a blank email to php-notes+get-141118@lists.php.net to get a copy of this message
I just thought I would post my version of str_split() for users of php4 <?php function str_split($string,$string_length=1) { if($string >= 1) { do { $c = strlen($string); $parts[] = substr($string,0,$string_length); $string = substr($string,$string_length); } while($string !== false); } else { $parts = false; } return $parts; } ?> It was designed to work the same as the php5 version to make it easy to move to php5 when the time comes ---- Server IP: 195.184.96.15 Probable Submitter: 90.184.224.226 ---- Manual Page -- http://www.php.net/manual/en/function.str-split.php Edit -- https://master.php.net/note/edit/84213 Del: integrated -- https://master.php.net/note/delete/84213/integrated Del: useless -- https://master.php.net/note/delete/84213/useless Del: bad code -- https://master.php.net/note/delete/84213/bad+code Del: spam -- https://master.php.net/note/delete/84213/spam Del: non-english -- https://master.php.net/note/delete/84213/non-english Del: in docs -- https://master.php.net/note/delete/84213/in+docs Del: other reasons-- https://master.php.net/note/delete/84213 Reject -- https://master.php.net/note/reject/84213 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#141118) next »