Get all open PHP extensions and functions under this extension

Source: Internet
Author: User
Tags lowercase zend


get_loaded_extensions-Returns an array of all compiled and loaded module names

Array get_loaded_extensions ([bool $zend _extensions = false])

This function returns all the compiled and loaded module names in the PHP parser.

Description Array get_loaded_extensions ([bool $zend _extensions = false])

This function returns all the compiled and loaded module names in the PHP parser.

Parameters

Zend_extensions

Returns only Zend extensions, not normal extensions like mysqli. The default is FALSE (returns a normal extension). return value

Returns an indexed array (array) of all module names.

Array
(
    [0] => Core
    [1] => bcmath
    [2] => calendar
    [3] => CType
    [4] => date
    [5  ] => ereg
    [6] => filter
    [7] => FTP
    [8] => Hash
    [9] => iconv
    [ten] => json
    [11] => MCrypt
    [[] => SPL
    [[] => ODBC
    [m] => pcre
    [a] => Reflection
    [[] => ses Sion
    [[] => standard
    [a] => mysqlnd
    [] => tokenizer
    [a] => zip
    [O] => zlib
    [=>] Libxml
    [[] => Dom
    [] => PDO
    [] => OpenSSL [a
    ] => SimpleXML [a
    ] => wddx
    [a] => XML
    [i] => XmlReader
    [a] => XmlWriter
    [to] => apache2handler
    [m] => Curl
    [33] = > GD
    [a] => mbstring
    [km] => MySQL
    [+] => mysqli
    [Notoginseng] => Phar
    [[PDF] => pdo_my SQL
    [m] => pdo_sqlite
    [[] => soap
    [a] => sqlite
    [] => mhash
)


get_extension_funcs-Returns an array of module function names

Description Array get_extension_funcs (string $module _name)

The function returns the names of all functions defined within the module based on Module_name. Parameters

Module_name

The module name.

Note:

This parameter must be lowercase (lowercase). return value

Returns an array containing all the function names, FALSE If module_name is not a valid extension. extension_loaded-Check if an extension has been loaded

Description bool extension_loaded (string $name)

Check to see if an extension has already been loaded. Parameters

Name

Extended name, case insensitive. return value

Returns true if the extension specified by name is loaded, or FALSE.



Example:


$ext _info = Array ();
$loaded _extensions=get_loaded_extensions ()///Get Loaded Extension
foreach ($loaded _extensions as $ext)
{
    $funs = Get_extension_funcs ($ext);//Get all functions under an extension
    if (!empty ($funs) && Is_array ($funs))
    {
        foreach ($ Funs as $fun)
        {
            $reflect = new Reflectionfunction ($fun);
            $params = $reflect->getparameters ()///Get function parameter information
            $param _str = ';
            if (!empty ($params) && Is_array ($params))
            {
                foreach ($params as $param) {
                    if ($param-> GetName ()!= ')
                    {
                        $param _str. = ' $ '. $param->getname (). ', ';
                    }
                }
                $param _str = substr ($param _str,0,-1);
            }
            $ext _info[$ext] = $fun. ' ('. $param _str. ') ';
}}} Echo ' <pre> ';
Print_r ($ext _info);


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.