note 117710 deleted from function.array-slice by cmb

From: Date: Mon, 27 Jul 2015 12:03:46 +0000
Subject: note 117710 deleted from function.array-slice by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-203192@lists.php.net to get a copy of this message
Note Submitter: kezzyhko at gmail dot com ---- ( If $offset is negative and abs($length)>count($length) ) or ( $offset>count($array) ) etc, array_slice returns empty array. For example: <?php $array = array( 'a'=>'1', 'b'=>'2', 'c'=>'3', 'd'=>'4', 'e'=>'5', 'f'=>'6', 'g'=>'7', 'h'=>'8' ); print_r( array_slice($test, 2, -10) ); print_r( array_slice($test, 10, 1) ); print_r( array_slice($test, 10, 15) ); //prints //Array() //Array() //Array() ?>

« previous php.notes (#203192) next »