why dont you take a look to this?
is the same question i did 2 years ago. hehe.
and i think this is probably what you have been waiting for.

defining and calling functions with multidimentional arrays as arguments