开发者

how to display array elements php

开发者 https://www.devze.com 2023-04-09 11:59 出处:网络
For example; in PHP the au开发者_运维问答to-global $_SERVER. How do I display the elements or keys that it has?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号