Re: [nyphp-talk] delete one element from array

2009-06-07 Thread Greg Rundlett (freephile)
> > I have a Yahoo! Pipe set up for just this purpose, if you want to use it. > Just json_encode() your array, POST it via cURL to the appropriate URL, and > parse the resulting RSS feed. > > :P I just use a butterfly for that http://xkcd.com/378/ -- Greg Rundlett Web Developer - Initiative in

Re: [nyphp-talk] delete one element from array

2009-06-07 Thread Justin Hileman
Mitch Pirtle wrote: Elijah, you forgot to use Amazon Queues. Sheesh. Amateurs. -- Mitch, trying to keep a straight face, and failing On Thu, Jun 4, 2009 at 1:55 PM, Elijah Insua wrote: @chris, you forgot to json_encode, mail() to a remote service, and sleep() while you wait for the results

Re: [nyphp-talk] delete one element from array

2009-06-04 Thread Mitch Pirtle
Elijah, you forgot to use Amazon Queues. Sheesh. Amateurs. -- Mitch, trying to keep a straight face, and failing On Thu, Jun 4, 2009 at 1:55 PM, Elijah Insua wrote: > @chris, you forgot to json_encode, mail() to a remote service, and sleep() > while you wait for the results > > On Thu, Jun 4, 2

Re: [nyphp-talk] delete one element from array

2009-06-04 Thread CED
Chris Snyder wrote: On Thu, Jun 4, 2009 at 12:39 PM, wrote: yeah i think unset would work just fine. So much for my serialize() / preg_replace() / unserialize() hack. ___ New York PHP User Group Community Talk Mailing List http://lists.nyp

Re: [nyphp-talk] delete one element from array

2009-06-04 Thread Elijah Insua
@chris, you forgot to json_encode, mail() to a remote service, and sleep() while you wait for the results On Thu, Jun 4, 2009 at 1:34 PM, Chris Snyder wrote: > On Thu, Jun 4, 2009 at 12:39 PM, wrote: > > yeah i think unset would work just fine. > > > > So much for my serialize() / preg_replace

Re: [nyphp-talk] delete one element from array

2009-06-04 Thread Chris Snyder
On Thu, Jun 4, 2009 at 12:39 PM, wrote: > yeah i think unset would work just fine. > So much for my serialize() / preg_replace() / unserialize() hack. ___ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk

Re: [nyphp-talk] delete one element from array

2009-06-04 Thread y2rob
yeah i think unset would work just fine. ~rob -Original Message- From: Eddie Drapkin To: NYPHP Talk Sent: Wed, 3 Jun 2009 9:26 pm Subject: Re: [nyphp-talk] delete one element from array Nope, because that'll unset the eighth element! You want unset($array[6

Re: [nyphp-talk] delete one element from array

2009-06-03 Thread Darryle Steplight
There's a few ways to skin this cat but Eddie is right. Based one this email's title I think using unset() should suffice. On Wed, Jun 3, 2009 at 9:43 PM, Eddie Drapkin wrote: > unset() will work, but won't reset the numerical index, which is the only > thing array_slice is being used for; if he

Re: [nyphp-talk] delete one element from array

2009-06-03 Thread Eddie Drapkin
unset() will work, but won't reset the numerical index, which is the only thing array_slice is being used for; if he needs the index in the same order, unset() is a better option as it's faster, but if he needs a re-index, we'd have to benchmark :] On Wed, Jun 3, 2009 at 9:40 PM, John Campbell wr

Re: [nyphp-talk] delete one element from array

2009-06-03 Thread John Campbell
I think you want array_splice, rather than array_slice array_splice($arr,6,1); Regards, -John Campbell ___ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show_participation.php

Re: [nyphp-talk] delete one element from array

2009-06-03 Thread Eddie Drapkin
Nope, because that'll unset the eighth element! You want unset($array[6]) :P And then if you want to re-key the array: array_slice($array) On Wed, Jun 3, 2009 at 9:17 PM, Darryle Steplight wrote: > unset($array['7']) doesn't work? > > On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell > wrote:

Re: [nyphp-talk] delete one element from array

2009-06-03 Thread Michael Southwell
Darryle Steplight wrote: unset($array['7']) doesn't work? I said it would be easy... -- = Michael Southwell Vice President, Education NYPHP TRAINING: http://nyphp.com/Training/Indepth ___ New York PHP User Group Community Talk M

Re: [nyphp-talk] delete one element from array

2009-06-03 Thread CED
Darryle Steplight wrote: unset($array['7']) doesn't work? On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell wrote: This has to be easy but I'm so pre-occupied with other stuff that I can't get it. I have an array, let's say 12 elements. I want to remove element 7. I could array_slice out t

Re: [nyphp-talk] delete one element from array

2009-06-03 Thread Darryle Steplight
unset($array['7']) doesn't work? On Wed, Jun 3, 2009 at 9:14 PM, Michael Southwell wrote: > This has to be easy but I'm so pre-occupied with other stuff that I can't > get it. > > I have an array, let's say 12 elements. I want to remove element 7. I could > array_slice out the first 6 and also th