How to get the function name of a module in PHP

藏色散人
Release: 2021-01-11 10:49:41
Original
7184 people have browsed it

PHP obtains the function name of the module, which can be achieved through the get_extension_funcs function. Such as searching XML, JSON functions.

How to get the function name of a module in PHP

Let’s use code examples to introduce how to get module function names in PHP.

The code example is as follows:

";
print_r(get_extension_funcs("JSON"));
echo "
"; print_r(get_extension_funcs("XML"))."\n";
Copy after login

The output result is as follows:

Array
(
    [0] => json_encode
    [1] => json_decode
    [2] => json_last_error
    [3] => json_last_error_msg
)
Array
(
    [0] => xml_parser_create
    [1] => xml_parser_create_ns
    [2] => xml_set_object
    [3] => xml_set_element_handler
    [4] => xml_set_character_data_handler
    [5] => xml_set_processing_instruction_handler
    [6] => xml_set_default_handler
    [7] => xml_set_unparsed_entity_decl_handler
    [8] => xml_set_notation_decl_handler
    [9] => xml_set_external_entity_ref_handler
    [10] => xml_set_start_namespace_decl_handler
    [11] => xml_set_end_namespace_decl_handler
    [12] => xml_parse
    [13] => xml_parse_into_struct
    [14] => xml_get_error_code
    [15] => xml_error_string
    [16] => xml_get_current_line_number
    [17] => xml_get_current_column_number
    [18] => xml_get_current_byte_index
    [19] => xml_parser_free
    [20] => xml_parser_set_option
    [21] => xml_parser_get_option
    [22] => utf8_encode
    [23] => utf8_decode
)
Copy after login

Function introduction:

get_extension_funcs() function , returns an array of module function names.

array get_extension_funcs ( string $module_name )
Copy after login

This function returns the names of all functions defined within the module based on module_name.

The parameter module_name is the module name.

Note: This parameter must be lowercase (lowercase).

Return value, returns an array containing all function names, or returns FALSE if module_name is not a valid extension.

This article is an introduction to how to obtain the module function name in PHP. It is simple and easy to understand. I hope it will be helpful to friends in need!

The above is the detailed content of How to get the function name of a module in PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!