note 101193 modified in function.end by danbrown

From: Date: Wed, 01 Dec 2010 23:12:37 +0000
Subject: note 101193 modified in function.end by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-174534@lists.php.net to get a copy of this message
It's interesting to note that when creating an array with numeric keys in no particular order, end() will still only return the value that was the last one to be created. So, if you have something like this: <?php $a = array(); $a[1] = 1; $a[0] = 0; echo end($a); ?> This will print "0". --was-- It's interesting to note that when creating an array with numeric keys in no particular order, end() will still only return the value that was the last one to be created. So, if you have something like this: <?php $a = array(); $a[1] = 1; $a[0] = 0; echo end($a); This will print "0". http://php.net/manual/en/function.end.php

« previous php.notes (#174534) next »