[thelist] very deep arrays... a work around...?

Fred Jones fredthejonester at gmail.com
Thu Aug 2 10:43:27 CDT 2007


Tris wrote:
> http://www.tlc-rewards.com/_postcodeChecker/array.txt
> 
> I have to parse the array linked above.
> it's really deep and my page is full of foreach function calls...
> 
> it's ugly and rather confusing..
> is there a better way to go to the info directly..?

I don't think so. What I would do anyhow is make it clearer by something 
like this:

foreach( as $cinema)
{
  processCinema($cinema);
}

and then:

function processCinema($cinema)
{
  foreach($cinema as $film)
  {
   processFilm($film);
  }
}

to encapsulate each one. Then each function and each foreach should be 
fairly simple to work with.

My 2 cents.

Fredster



More information about the thelist mailing list