Re: Echo a value from an arrays position

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

 



Dave Goodchild wrote:
This may clarify - in php, integer and associate arrays are created
arbitrarily, ie keys can be numbers or strings. So, either create an array
like this:

array('1' => 'first element',
       '2' => 'second element');

if I'm not mistaken the above example will result in an array with
2 *numeric* keys because any strings keys that php that are numeric
(according to the logic of is_numeric()) will be seen as numeric keys.

so the above example could lead to even more confusion!


and call by the key!

On 04/05/06, Jonas Rosling <webmaster@xxxxxxxxxxxx> wrote:


Is there any way to call for an element value in an array by the position?
Like position 2 in the array and not the key name.

// Jonas

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




--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


--
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