Greg Donald wrote:
On Mon, 11 Oct 2004 09:07:13 -0700, Brian Dunning
<[EMAIL PROTECTED]> wrote:
Say I'm trying to add a value to an array, only if it's not already in
there somewhere; so I do an array_search to see. The problem is that if
the item is at index 0 in the array, array_search gives the
Brian Dunning wrote:
Say I'm trying to add a value to an array, only if it's not already in
there somewhere; so I do an array_search to see. The problem is that if
the item is at index 0 in the array, array_search gives the same answer
as if it's not in there at all.
No it doesn't. If the value
On Mon, 11 Oct 2004 09:07:13 -0700, Brian Dunning
<[EMAIL PROTECTED]> wrote:
> The problem is that if the item is at index 0 in the array, array_search gives the
> same answer as if it's not in there at all.
No it doesn't.
If it's in index 0 it returns 0, if it's not there at all it returns FA
On Mon, 11 Oct 2004 09:07:13 -0700, Brian Dunning
<[EMAIL PROTECTED]> wrote:
> Say I'm trying to add a value to an array, only if it's not already in
> there somewhere; so I do an array_search to see. The problem is that if
> the item is at index 0 in the array, array_search gives the same answer
>
> Say I'm trying to add a value to an array, only if it's not already in
> there somewhere; so I do an array_search to see. The problem is that if
> the item is at index 0 in the array, array_search gives the same answer
> as if it's not in there at all. How does one circumvent this potential
> pit
Say I'm trying to add a value to an array, only if it's not already in
there somewhere; so I do an array_search to see. The problem is that if
the item is at index 0 in the array, array_search gives the same answer
as if it's not in there at all. How does one circumvent this potential
pitfall?
6 matches
Mail list logo