When I want to print the content of an Array, I always get the strin开发者_如何学Cg "Array" instead of the content.
I've also tried: implode(",", $myArray);
but still I get "Array" rather than the content itself
Use print_r()
to recursively print arrays.
implode()
takes a maximum of two arguments:
string implode ( string $glue , array $pieces )
Try var_dump()
, var_export()
or print_r()
instead:
var_dump($myArray);
var_export($myArray);
print_r($myArray);
var_dump($theArray);
This prints out the array in nice tabbed format, with both the keys / indices, value types and values shown.
精彩评论