Re: Simple Array Question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Russell Jones wrote:
> lets say I have an array...
> 
> $myArray = array (
> 
> "firstkey" => "first val",
> "secondkey" => "second val"
> 
> )
> 
> 
> Can I still call these by their numeric order? ie, echo $myArray[0] shoudl
> print out "first val"...


No, but you can do:
$myArrayNumeric = array_values($myArray);
echo $myArrayNumeric[0];

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux