note 18544 added to function.array-slice

From: Date: Sun, 27 Jan 2002 14:14:26 +0000
Subject: note 18544 added to function.array-slice
Groups: php.notes 
Request: Send a blank email to php-notes+get-25867@lists.php.net to get a copy of this message
The same thing, written by a maladroit :) function array_slice2( $array, $offset, $length = 0 ) { if( $offset < 0 ) $offset = sizeof( $array ) + $offset; $length = ( !$length ? sizeof( $array ) : ( $length < 0 ? sizeof( $array ) - $length : $length + $offset ) ); for( $i = $offset; $i < $length; $i++ ) $tmp[] = $array[$i]; return $tmp; } -- http://www.php.net/manual/en/function.array-slice.php http://master.php.net/manage/user-notes.php?action=edit+18544 http://master.php.net/manage/user-notes.php?action=delete+18544 http://master.php.net/manage/user-notes.php?action=reject+18544

« previous php.notes (#25867) next »