| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor|
|Is it possible to reference an associative array key by it's position|
Looking for a way to reference variable associative array key names.
| 6:39 pm on Mar 7, 2010 (gmt 0)|
Is it possible to refer to an associative array key by the position it was added to the array?
For example, let's say that I have a dynamic result set. I don't know the column names (e.g. associative array key names), but would like to reference the first column or second column numerically.
Is there a built-in function to do this (couldn't find one), or do I need to loop through the keys and assign them to a numerically indexed array.
Let me know if that question makes sense. I always struggle with arrays.
| 6:06 am on Mar 8, 2010 (gmt 0)|
any index can still be accessed numerically, like this
echo $myArray; //"World"
echo $myArray; //"Testing"
Same for multidimensional arrays
Sorry if i have not understood the question correctly.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2014 all rights reserved