RE: [PHP] in the middle of shift and pop
| From: | Ford, Mike [LSS] | Date: | Wed, 20 Aug 2003 12:27:51 +0000 |
| Subject: | RE: [PHP] in the middle of shift and pop | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-160165@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Decapode Azur [mailto:blue_prawn@tuxfamily.org]
> Sent: 20 August 2003 00:10
>
> > unset($A[2]);
>
> No this function does not exactly what I want.
> unset() makes empty hole with $A[2] = Null
>
> I would like to have this result :
> Array
> (
> [0] => a
> [1] => b
> [2] => d
> [3] => e
> [4] => f
> )
> and not this one :
> Array
> (
> [0] => a
> [1] => b
> [3] => d
> [4] => e
> [5] => f
> )
I'm compelled to ask *why* you want that result. In most cases it makes no
difference to your coding, so the only real reason I can see is a somewhat
obsessive desire for neatness!
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