Page 1 of 1

Simple Quick Array Question

Posted: Sat Sep 11, 2004 5:55 am
by lazersam
Hi, I know I should know this but I haven’t used arrays in ages and can not find this solution in my books....

Simply, I have built an array as follows

Code: Select all

$list = array();
$listї3]="50"; $listї29]="45";$listї67]="89";
I am trying to read the 'list' array and its keys back. I need to know that 3=50, 29=45 and 67=89.

I do not want to loop from 0 to 67. I only want to loop three times and retrieve the keys and data.

Could someone give an example on how I could do this?

Posted: Sat Sep 11, 2004 6:05 am
by timvw
[php_man]array_keys[/php_man]

Posted: Sat Sep 11, 2004 6:16 am
by lazersam
Wow - thanks!