how to display array elements php
For example; in PHP the au开发者_运维问答to-global $_SERVER
. How do I display the elements or keys that it has?
I am unable to find out how online.
$keys = array_keys($somearray);
Is that what you're looking for? Or are you just looking for $somearray['somekey']
?
For debugging I assume?
There are a couple ways, but I always do something like this:
die(print_r($_SERVER));
Look into var_dump() and print_r. Both options should provide what you're looking for without having additional clarification for your request.
精彩评论