phpbar.de logo

Mailinglisten-Archive

[php] AW: [php] array_splice-Alternative unter PHP3

[php] AW: [php] array_splice-Alternative unter PHP3

Wolfgang wbh_(at)_euta.net
Fri, 19 May 2000 17:42:12 +0200


$array = array("1","2","3","4","5","6","7","8","9","10","11","12","13");
$array = array_splice($array, 10);
// Array ist nun: array("1","2","3","4","5","6","7","8","9","10");

Hi Christoph,

Hier noch ne Methode mit unset:

function array_splice($array, $anzahl)
{	for ($i=($anzahl + 1);$i<= count($array);$i++) 
            unset($array[$i]);
	return array;
}

Allen ein schoenes Wochenende

CU
Wolfgang
-- 
** Durchgehend geoffnet: http://www.php-center.de **
Die PHP-Liste: mailto:php_(at)_php-center.de
http://infosoc.uni-koeln.de/mailman/listinfo/php




php::bar PHP Wiki   -   Listenarchive