Here's a nice stupid php trick you can use when debugging a script with lots of oddly built arrays.
Say we get an array back from some function like db_fetch_array... Often we will have an array that has associative keys, like this:
$row["loc"]="downtown";
$row["color"]="blue";
...
$row["car"]=$mustang";
but we may not know the names of the fields already. While it may be easy to check the db in some instances, in others, we may not have access to it directly, and we don't feel like looping across the row set with db_fieldname to find each one.
In this case, we can use implode and array_keys to get a quick listing of the fieldnames:
print implode("<BR>",array_keys($row));