No. :-)

What I've had to do is add a dummy value, unset($array[4]) and then array_pop the 
dummy value off
the array to get it out of there completely. The reason: unset will only remove 
$array[4]'s value,
not the key.

There are plenty of other ways I'm sure, but simply unsetting has really messed me up 
on occasion.
I'll unset a value and then implode my array (say a list of numbers), and end up with 
a string like


Where I've unset the 4th and last keys. Which of course really messes up and explode.

# Nathan

----- Original Message -----
From: "Liam Gibbs" <[EMAIL PROTECTED]>
Sent: Thursday, April 25, 2002 1:22 PM
Subject: [PHP] Array function to delete

I've been checking the PHP documentation, but can't
find a function that will delete a member of an array,
like such:

$a = array(1, 2, 3, 4, 5);

Use the function, say array_delete($a, 3); and that
will delete the third member in the array (which would
be 4 above), so that the array would contain 1, 2, 3,

Is there such a function?

Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to