Q:

PHP - Convert a multidimensional array to string?

I'm working on a small ajax application and need to see if the values being generated in the background are what is expected.  The value returned by the quest can be quite a complex multidimensional array, is there a way to convert this into a string so that it can be shown with alert?
Is there any other way of seeing these values?
Any advice appreciated.
Thanks.

A:

print_r, var_dump or var_export are good candidates. while coding an ajax application, you might also want to look at json_encode.

A:

If you want to show it with javascript, I would recommend json_encode(), everything else has been covered by knittl's answer.

A:

i work on a bunch of ajax apps.. in firefox i have an "add-on" called JSON view
then all my projects have a function 
function test_array($array) {
    header("Content-Type: application/json");
    echo json_encode($array);
    exit();
}

so whenever i want to see what the output is i just go test_array($something) and it shows me the results. 

its made debugging a breaze now
PS. know this Q is ancient and im not really answering the origional posters Q but might be useful for someone else aswell

