How to test that an array is 'indexed' vs 'associative'
- From: Daniel Klein <danielk@xxxxxxxxxxxxxxxx>
- Date: Sat, 31 May 2008 09:57:07 -0400
I have a class constructor that accepts an array as the only argument. The
catch is that the array MUST be an 'integer-indexed' array, not an
'associative' array, because the index position has meaning.
How can I test for this in the constructor without having to traverse the
entire array and checking to make sure the keys are numeric and sequential?
Daniel Klein
Cuyahoga Falls, OH
.
- Follow-Ups:
- Re: How to test that an array is 'indexed' vs 'associative'
- From: NC
- Re: How to test that an array is 'indexed' vs 'associative'
- From: Rik Wasmus
- Re: How to test that an array is 'indexed' vs 'associative'
- From: jpedrobarbosa
- Re: How to test that an array is 'indexed' vs 'associative'
- Prev by Date: Re: using fopen() in write mode is failing
- Next by Date: Re: How to test that an array is 'indexed' vs 'associative'
- Previous by thread: Looking for Open Source Partner
- Next by thread: Re: How to test that an array is 'indexed' vs 'associative'
- Index(es):
Relevant Pages
|