List Info

Thread: note 77477 added to function.each




note 77477 added to function.each
user name
2007-08-30 21:11:47
manz_2007 at yahoo dot com:

You don't seem to understand what a key is. It is the unique
key which references the item in the array. It can't be
duplicated. To make it more clear:

array[0]="hello";
array[0]="world";
print(array[0]);

array[0] will obviously print "world". This is
because you first set the array element with the key 0 to
hello, and then set it to world. The old value is
overwritten.

In your example hire_date is a key, just like 0 is. You set
the value of it twice, and of course the second value
overwrites the first.

You can of course enter duplicate values into an array, but
not keys. Think about it, how would you reference two
different values with one key?
----
Server IP: 209.41.74.194
Probable Submitter: 72.82.184.111
----
Manual Page -- http:/
/www.php.net/manual/en/function.each.php
Edit        -- https://master
.php.net/note/edit/77477
Del: integrated  -- h
ttps://master.php.net/note/delete/77477/integrated
Del: useless     -- http
s://master.php.net/note/delete/77477/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/77477/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/77477/spam
Del: non-english -- 
https://master.php.net/note/delete/77477/non-english
Del: in docs     -- http
s://master.php.net/note/delete/77477/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/77477
Reject      -- https://mast
er.php.net/note/reject/77477
Search      -- https://
master.php.net/manage/user-notes.php

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


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )