Return Split Data to Array/What Logic for Key Order?

eugen helbling eugen.helbling at ginit-technology.com
Fri Dec 14 05:35:01 EST 2001


Hi Sivakatirswami,

Sivakatirswami wrote:
> 
> What is the logic behind returned array key order??
> 
> Take this (dummy) data submitted by a web form:
> 
> email=katir%40hindu.org&2+First=Siva&3+Last=Katirswami&4+add1=107+Kaholalele
> +Road&5+add2=Tampines+Quarter&6+add3=+Nottingham+Sector&7+City=Kapaa&8+US_St
> ate=HI&9+foreign_state=&10+Zip=96746&11+Country=USA&12+Phone=808-822-7032&13
> +body=What+a+wonderful+web+site%21
> 
> process with this script:
> 
>   split aboveData by "&" and "="
>   put the keys of aboveData
> 
> returns:
> 
> 5 add2
> 7 City
> 8 US_State
> 9 foreign_state
> 10 Zip
> 12 Phone
> 11 Country
> 4 add1
> 3 Last
> email
> 13 body
> 2 First
> 6 add3
> 
> ?? returned order bears no relation whatsoever to input order?? why? and
> what is the algorithm for the order of the keys returned? How to control it?

here could be de answer to your question (I asked Scott some time ago)
---------------
> Hi Scott,
>...
> 1. can I get the keys of one array in order of their creation ? 

No.  The keys are in (essentially) random order, based on their hash
value (a combination of the bytes in the key name).
----------------


> 
> TIA!
> 
> Hinduism Today
> 
> Sivakatirswami
> Editor's Assistant/Production Manager
> katir at hindu.org
> www.HinduismToday.com, www.HimalayanAcademy.com,
> www.Gurudeva.org, www.hindu.org
> 
> Read The Master Course Lesson of the Day at
> http://www.gurudeva.org/lesson.shtml
> 
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard


-- 
Eugen Helbling
_____________________________________________________________________

   GINIT Technology GmbH        eugen.helbling at ginit-technology.com
   Eugen Helbling                          www.ginit-technology.com
   Emmy-Noether-Str. 11                    phone:   +49-721-96681-0
   D-76131 Karlsruhe                       fax:   +49-721-96681-111



More information about the metacard mailing list