Sunray said:Thats fairly unreadable isn't it. I much prefer the code in the original post.
That's work in progress. What I'd actually use would be what I put a few posts later in post 11.
You might prefer the original code - but wait until you've actually tried maintaining code where the numeric array keys are explicitly defined. Trust me, it's a pain in the arse.
I used to be head of IT for this law firm in the city - they had this bespoke document management system where (among other things) numeric keys were explicityly defined like this - every time a member of staff left it would take about 1/2 a day going through the thing renumbering everything... and if you're doing that amount of stuff by hand, there will always be typos.