Posted by Chris Hope on 10/24/40 11:17
Bob Johnson wrote:
> I hope this is a silly questions (been programming for 4 days
> straight)...
>
> Given an array:
> $foo = array(one=>11,two=>22,tree=>33);
>
> $fum = $foo[0];
>
> $fum returns null. There are cases where I won't know the name "one"
> and still need to access by Index.
That's because there is no value in your array with index 0.
> HELP!!!
Refer to the array_keys() function to find out how to get all the index
names of an array: http://www.php.net/array_keys
--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Navigation:
[Reply to this message]
|