note 37804 deleted from function.array-slice by vincent

From: Date: Thu, 27 Nov 2003 21:39:54 +0000
Subject: note 37804 deleted from function.array-slice by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-61048@lists.php.net to get a copy of this message
Note Submitter: jw@jwscripts.com ---- When you pass an array by reference, array_slice will reduce it: <? $numbers = explode(",","340,102,103,1044,503,2503,1035,3025,321,782,291"); $message_split = 4; while (count($numbers) > 0) { $number = array_splice(&$numbers, 0, $message_split); echo implode(", ", $number)."<br />"; } ?> This will print: 340, 102, 103, 1044 503, 2503, 1035, 3025 321, 782, 291

« previous php.notes (#61048) next »