Re: Echo a value from an arrays position
| From: | Jochem Maas | Date: | Sun, 07 May 2006 18:58:45 +0000 |
| Subject: | Re: Echo a value from an arrays position | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235692@lists.php.net to get a copy of this message | ||
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',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!'2' => 'second element');
and call by the key! On 04/05/06, Jonas Rosling <webmaster@gamearena.se> 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!