I copied this thread to some co-workers with the subject line "Be glad
that you're not programmers".
Is it Friday yet?
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://en.wikipedia.org/wiki/Two_Little_Dickie_Birds
At 4:31 PM -0400 3/14/11, Paul M Foster wrote:
Here's what I need to do: I have an indexed array, from which I need to
delete elements in the middle. Once completed, the indexes should be
numerically in sequence, as they were when I first encountered the
array. That is:
Before:
$arr = array(0 =>
On Mar 15, 2011 5:05 PM, "Paul M Foster" wrote:
>
> On Tue, Mar 15, 2011 at 07:08:28AM +0100, Peter Lind wrote:
>
> >On Mar 15, 2011 4:10 AM, "Paul M Foster" <[1]pa...@quillandmouse.com>
> >wrote:
> >>
> >> On Mon, Mar 14, 2011 at 10:14:53PM +0100, Peter Lind wrote:
> >>
> >
On Tue, Mar 15, 2011 at 07:08:28AM +0100, Peter Lind wrote:
>On Mar 15, 2011 4:10 AM, "Paul M Foster" <[1]pa...@quillandmouse.com>
>wrote:
>>
>> On Mon, Mar 14, 2011 at 10:14:53PM +0100, Peter Lind wrote:
>>
>> > On 14 March 2011 22:10, Paul M Foster <[2]pa...@quillandmouse
On 3/14/2011 2:02 PM, Jim Lucas wrote:
> On 3/14/2011 1:31 PM, Paul M Foster wrote:
>> Here's what I need to do: I have an indexed array, from which I need to
>> delete elements in the middle. Once completed, the indexes should be
>> numerically in sequence, as they were when I first encountered th
On Mar 15, 2011 4:10 AM, "Paul M Foster" wrote:
>
> On Mon, Mar 14, 2011 at 10:14:53PM +0100, Peter Lind wrote:
>
> > On 14 March 2011 22:10, Paul M Foster wrote:
>
> [snip]
>
> > >> Remove the elements, then use sort().
> > >
> > > I've given a simplified example. The actual target array is
> >
On Mon, Mar 14, 2011 at 10:14:53PM +0100, Peter Lind wrote:
> On 14 March 2011 22:10, Paul M Foster wrote:
[snip]
> >> Remove the elements, then use sort().
> >
> > I've given a simplified example. The actual target array is
> > multi-dimensional. Sort() won't work in a case like that, as far a
how about creating two arrays, one empty one.
pop the elements
you want out of the first array and push them to the second. skip
the push on the elements you don't want in the second array?
Just a thought.
--curtis
Paul M Foster wrote:
> On Mon, Mar 14, 2011 at 09:34:33PM +0100, Peter Lind w
> I've given a simplified example. The actual target array is
> multi-dimensional.
Your questioni sn't entirely clear but there's lot of chatter about
multidimensional arrays on the array_values() page that might provide
a solution.
--
PHP General Mailing List (http://www.php.net/)
To unsubscrib
On 14 March 2011 22:10, Paul M Foster wrote:
> On Mon, Mar 14, 2011 at 09:34:33PM +0100, Peter Lind wrote:
>
>> On 14 March 2011 21:31, Paul M Foster wrote:
>> > Here's what I need to do: I have an indexed array, from which I need to
>> > delete elements in the middle. Once completed, the indexes
On Mon, Mar 14, 2011 at 09:34:33PM +0100, Peter Lind wrote:
> On 14 March 2011 21:31, Paul M Foster wrote:
> > Here's what I need to do: I have an indexed array, from which I need to
> > delete elements in the middle. Once completed, the indexes should be
> > numerically in sequence, as they were
On 3/14/2011 1:31 PM, Paul M Foster wrote:
> Here's what I need to do: I have an indexed array, from which I need to
> delete elements in the middle. Once completed, the indexes should be
> numerically in sequence, as they were when I first encountered the
> array. That is:
>
> Before:
> $arr = ar
> Here's what I need to do: I have an indexed array, from which I need to
> delete elements in the middle. Once completed, the indexes should be
> numerically in sequence, as they were when I first encountered the
> array.
I believe that array_values() will do the trick.
Marc
--
PHP General Mai
On 14 March 2011 21:31, Paul M Foster wrote:
> Here's what I need to do: I have an indexed array, from which I need to
> delete elements in the middle. Once completed, the indexes should be
> numerically in sequence, as they were when I first encountered the
> array. That is:
>
> Before:
> $arr =
15 matches
Mail list logo