hey,
so i am just hoping that someone has done this before and it is a quick copy paste for you.
I am working on a site where the only access that I have to anything from the database is VIA an array that I can display by listing the variables. but it gets a little bit messy (to say the least).
I am looking for a way to recursively loop through an array and display the contents either in a component that i will build or just tracing out.
I currently have the following:
public function printArray (obj) {
trace(obj);
for (var item in obj)
{
trace(item + " = " + obj[item]);
printArray (obj[item]);
}
}
it works fine but returns a mess. I am looking to make something like print_r does in PHP where it either indents or just intelligently displays the contents.
Please let me know if you have done anything like this before and how it works.
cheers, marc