note 104448 deleted from function.end by danbrown

From: Date: Wed, 15 Jun 2011 23:05:36 +0000
Subject: note 104448 deleted from function.end by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180588@lists.php.net to get a copy of this message
Note Submitter: hajikelist ---- //a bit faster, and still correct, way to get last array key $id = 'testindex'; $busters = array(); for ($a=0;$a<20000;$a++) { $busters[$id.$a] = $id.$a. '_value'; } $last_entry = array_slice($busters, count($busters)-1); //now use array keys - less wasteful for large arrays $buster = array_pop(array_keys($last_entry));

« previous php.notes (#180588) next »