Home Daily Programming PHP Knowledge How to get the function name of a module in PHP

How to get the function name of a module in PHP

Feb 16, 2019 pm 02:44 PM

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:

<?php
echo "<pre class="brush:php;toolbar:false">";
print_r(get_extension_funcs("JSON"));
echo "<br>";
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!

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 admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)