How to get phpinfo() variables from php programmatically?

前端 未结 3 2042
轻奢々
轻奢々 2021-02-07 08:04

I am attempting to get a list of dependable(consistent across requests) list of \"hidden\" constants in PHP(as in, the client-side won\'t know about it in most cases without hac

3条回答
  •  醉话见心
    2021-02-07 08:23

    Most of the stuff available from phpinfo() can be found in constants. Try looking through:

    print_r(get_defined_constants());
    

    Or the functions on this page: http://us.php.net/manual/en/ref.info.php. There are tons of functions to get information about specific extensions.

    The following functions might be worth looking at:

    ini_get() http://us.php.net/manual/en/function.ini-get.php
    getenv() http://us.php.net/manual/en/function.getenv.php
    get_cfg_var() http://us.php.net/manual/en/function.get-cfg-var.php

提交回复
热议问题