RE: [PHP] Array function to delete

From: Date: Fri, 26 Apr 2002 09:47:11 +0000
Subject: RE: [PHP] Array function to delete
Groups: php.general 
Request: Send a blank email to php-general+get-94712@lists.php.net to get a copy of this message
> -----Original Message----- > From: Nathan [mailto:etherwolf@sopris.net] > Sent: 25 April 2002 21:01 > > Apparently in 4.1.X this is true... I'd been running 4.0.6 > for a long time (until 4.1.2 was > released), and must have coded it in the earlier version. I > stand corrected! :-) H'mmm, I think you must have an even longer memory than that, since the following script: > <?php > $array = array(); > $array[0] = "zero"; > $array[1] = "one"; > $array[2] = "two"; > $array[3] = "three"; > > unset($array[1]); > echo "version=" . phpversion() . "<br>"; > foreach ($array as $key=>$value) { > echo $key." = ".$value."<BR>"; > } > ?> when run on my server produces: version=4.0.5 0 = zero 2 = two 3 = three Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#94712) next »