On Tue, 2 Sep 2003 21:40:35 -0500
"John Macon" <[EMAIL PROTECTED]> wrote:
> I have a quick question about arrays. I know that this is probably pretty easy for
> most of you out there, so here it goes.
>
> If you remove $array[2], would $array[3] then automatically become the new $array[2]?
>
>
Yes, it should. Check it yourself by printing out array values:
echo array[2];
echo array[3]; etc.
If it's a really long array and you want to print the whole thing, look at
foreach, http://us2.php.net/manual/en/control-structures.foreach.php
John:
How do you plan to "remove" an $array[2]?
If you are using associative arrays, then you can remove an element
using the unset() function, and then the answer to your question is
"yes", so to speak:
For example:
\n";
}
$array = array( 'first' => 'one', 'second' => 'two', 'third' =>
'thr
Sorry, I forgot that would help, I am using PHP 4, pulling from a mySQL database, I am
trying to delete a record in an array before it gets written back into the table,
should I be asking this in a PHP forum instead? I should have thought of that.