How do I differentiate between
single, multiple, and jagged type arrays?

Right now I only have the rank function to rely to, but that only works for multidimensional arrays.

I have this function that will print the values of an array.
The arrays passed may either be single, multiple or jagged.

I'd like the function intelligent enough to print jagged arrays as well.

Help will be appreciated.