Re: [PHP] Array function to delete

2002-04-26 Thread Liam Gibbs
> But PHP builtins will do exactly this, around 3 > times faster, too. :) Yup. This one with array_diff was the winner. Thanks to all for your suggestions and Lars for the working one. Liam __ Do You Yahoo!? Yahoo! Games - play chess, backgammon,

RE: [PHP] Array function to delete

2002-04-26 Thread Ford, Mike [LSS]
> -Original Message- > From: Nathan [mailto:[EMAIL PROTECTED]] > 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 thi

Re: [PHP] Array function to delete

2002-04-25 Thread Lars Torben Wilson
$tmplist[] = $listitems[$i]; > } > } > $listitems = $tmplist; //new array contains (grill, bar, world) > ?> > > -Kevin > > - Original Message - > From: "Liam Gibbs" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursda

Re: [PHP] Array function to delete

2002-04-25 Thread Kevin Stone
ing to get. :) -Kevin - Original Message - From: "Liam Gibbs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 25, 2002 2:27 PM Subject: Re: [PHP] Array function to delete > Thanks for all your help, everyone, but both > suggestions (unset and arr

Re: [PHP] Array function to delete

2002-04-25 Thread Erik Price
On Thursday, April 25, 2002, at 04:27 PM, Liam Gibbs wrote: > Thanks for all your help, everyone, but both > suggestions (unset and array_slice) pretty much didn't > improve on my current way. I was jsut trying to find a > faster way, but unset doesn't seem to be working > properly (but I'll ne

Re: [PHP] Array function to delete

2002-04-25 Thread Liam Gibbs
Thanks for all your help, everyone, but both suggestions (unset and array_slice) pretty much didn't improve on my current way. I was jsut trying to find a faster way, but unset doesn't seem to be working properly (but I'll need to fiddle more) and the array_slice way is just too intensive. for($c

Re: [PHP] Array function to delete

2002-04-25 Thread Richard Baskett
for the hardest victory is over self." - Aristotle > From: Lars Torben Wilson <[EMAIL PROTECTED]> > Date: 26 Apr 2002 12:50:03 -0700 > To: Pushkar Pradhan <[EMAIL PROTECTED]> > Cc: Erik Price <[EMAIL PROTECTED]>, Liam Gibbs <[EMAIL PROTECTED]>, > [EMAIL PROTE

Re: [PHP] Array function to delete

2002-04-25 Thread Nathan
ROTECTED]> Cc: "Liam Gibbs" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]> Sent: Friday, April 26, 2002 1:46 PM Subject: Re: [PHP] Array function to delete On Thu, 2002-04-25 at 12:34, Nathan wrote: > No. :-) > > What I've had to do is add a dummy valu

Re: [PHP] Array function to delete

2002-04-25 Thread Lars Torben Wilson
On Thu, 2002-04-25 at 12:32, Pushkar Pradhan wrote: > That's neat but I just read the docs. it says unset() won't work inside a > function, even if you pass by reference! No, that is not at all what it says. > Anyways as far as you don't use functions to do the delete it will work > fine. > > On

Re: [PHP] Array function to delete

2002-04-25 Thread Lars Torben Wilson
MAIL PROTECTED]> > To: <[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: >

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
e really messes up and explode. > > # Nathan > > - Original Message - > From: "Liam Gibbs" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, April 25, 2002 1:22 PM > Subject: [PHP] Array function to delete > > > I've been

Re: [PHP] Array function to delete

2002-04-25 Thread Nathan
e - From: "Liam Gibbs" <[EMAIL PROTECTED]> To: <[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

Re: [PHP] Array function to delete

2002-04-25 Thread Lars Torben Wilson
On Thu, 2002-04-25 at 12:22, Liam Gibbs wrote: > 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

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
That's neat but I just read the docs. it says unset() won't work inside a function, even if you pass by reference! Anyways as far as you don't use functions to do the delete it will work fine. > > On Thursday, April 25, 2002, at 03:22 PM, Liam Gibbs wrote: > > > I've been checking the PHP documen

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
As far as I know there isn't such a function, what I do to achieve this: 1. find the position of the element you want to remove 2. slice the array into 2 arrays one contains all elements before this and one contains all elements below this, 3. use shift to remove appropriate element 4. merge both

Re: [PHP] Array function to delete

2002-04-25 Thread Erik Price
On Thursday, April 25, 2002, at 03:22 PM, Liam Gibbs wrote: > 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

[PHP] Array function to delete

2002-04-25 Thread Liam Gibbs
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