Q: Array
| From: | Ivo Stoykov | Date: | Thu, 10 Jan 2002 20:18:38 +0000 |
| Subject: | Q: Array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-80063@lists.php.net to get a copy of this message | ||
Hi group:
I've following question:
How could I determine whether I have in the array's key integers *and*
strings or integers only?
i.e.
$a = new array('one', 'two', 'three'); // this has only integers (am I
wrong?)
$b = new array('one' => 'bla', 'two' => 'blabla',
'three' => 'blablabla');
// integers & strings
latter could be seen using while(list($k, $v) = each($b)) {...}
Result will be
0 (the key) = 'bla' (the value)
one (the key of the *same* element) = 'bla' (the *same* value)
I hope the question is clear enough and I'll highly appreciate your
comments. Thank you
Ivo