Correction:
$new_array will contain:
$new_array[0]="b"
$ar contains the modified array with elements removed.
HTH
Garth
-Original Message-
From: Garth Sperring [mailto:[EMAIL PROTECTED]]
Sent: Friday, 3 January 2003 12:25 PM
To: '[EMAIL PROTECTED]'
Subject: R
On Thu, 2003-01-02 at 17:24, David Busby wrote:
> List,
> Suppose you have an array in PHP like
>
> $ar = array("a", "b", "c", "d", "e", "f", "g");
>
> Now say you want to remove the 3rd item
>
> unset($ar[2]);
>
> All good? Not really...the array doesn't get shifted down, how could one
>
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
On Behalf Of David Busby
Sent: Friday, 3 January 2003 10:25 AM
To: [EMAIL PROTECTED]
Subject: PHP Code Question
List,
Suppose you have an array in PHP like
$ar = array("a", "b", "c", "d", "e",
At 06:24 PM 1/2/03, David Busby wrote:
Suppose you have an array in PHP like
$ar = array("a", "b", "c", "d", "e", "f", "g");
Now say you want to remove the 3rd item
unset($ar[2]);
All good? Not really...the array doesn't get shifted down, how could one
pull that off (or should I spin th
List,
Suppose you have an array in PHP like
$ar = array("a", "b", "c", "d", "e", "f", "g");
Now say you want to remove the 3rd item
unset($ar[2]);
All good? Not really...the array doesn't get shifted down, how could one
pull that off (or should I spin the array and recreate without the und