How to get all function names of a module in PHP ? Last Updated : 18 Jan, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will learn How to get the names of all functions present in a module in PHP. What is a module in PHP ? A module is a collection of independent software components. The usage of modules in program improves the code reusability and encapsulation. Module contains functions that we can use these functions by including the module in our code. Now we are going to print all the functions present in a given module. How to get the names of all functions of a module in PHP ? To get the names of all functions of a PHP module, we can use get_extension_funcs() function. This function takes the name of module as an input argument and returns the array of function names as output. Example 1: In this example, we will print all the functions present in JSON module. PHP <?php $func_names = get_extension_funcs("DOM"); $length = count($func_names); for($i = 0; $i < $length; $i++) { echo($func_names[$i]); echo("<br>"); } ?> Outputdom_import_simplexml Example 2: In this example we will print all the functions present in XML module. PHP <?php $func_names = get_extension_funcs("XML"); $length = count($func_names); for($i = 0; $i < $length; $i++) { echo($func_names[$i]); echo("<br>"); } ?> Outputxml_parser_create xml_parser_create_ns xml_set_object xml_set_element_handler xml_set_character_data_handler xml_set_processing_instruction_handler xml_set_default_handler xml_set_unparsed_entity_decl_handler xml_set_notation_decl_handler xml_set_external_entity_ref_handler xml_set_start_namespace_decl_handler xml_set_end_namespace_decl_handler xml_parse xml_parse_into_struct xml_get_error_code xml_error_string xml_get_current_line_number xml_get_current_column_number xml_get_current_byte_index xml_parser_free xml_parser_set_option xml_parser_get_option utf8_encode utf8_decode Example 3: In this example, we will print all the functions present in DOM module. PHP <?php $func_names = get_extension_funcs("JSON"); $length = count($func_names); for($i = 0; $i < $length; $i++) { echo($func_names[$i]); echo("<br>"); } ?> Outputjson_encode json_decode json_last_error json_last_error_msg Comment More infoAdvertise with us Next Article How to get all function names of a module in PHP ? P pulamolusaimohan Follow Improve Article Tags : Web Technologies PHP PHP Programs PHP-Misc Similar Reads How to get name of calling function/method in PHP ? Why need to get the name of calling function? The code consist of multiple functions performing different tasks but associated with each other directly or indirectly, and suddenly display an error in some of the functions then it will become necessary to find the name of the function in which an err 3 min read How to get the function name inside a function in PHP ? To get the function name inside the PHP function we need to use Magic constants(__FUNCTION__). Magic constants: Magic constants are the predefined constants in PHP which is used on the basis of their use. These constants are starts and end with a double underscore (__). These constants are created b 1 min read How to find out where a function is defined using PHP ? When we do projects then it includes multiple modules where each module divided into multiple files and each file containing many lines of code. So when we declare a function somewhere in the files and forget that what the function was doing or want to change the code of that function but can't find 3 min read PHP | Check if a variable is a function To determine whether a passed argument is a function or not, Few of the most preferred methods are shown below. Using is_callable() Function: It is an inbuilt function in PHP which is used to verify the contents of a variable in called as a function. It can check that a simple variable contains the 3 min read How to know which php.ini file is used ? The php.ini file is the default configuration file used for running applications that require PHP. It is an effective way to work on PHP's functionality. It is used to control variables like file timeouts, sizes of the upload, and the limits of the resource on which it works. 1. Check php.ini in CGI 2 min read How to see the extensions loaded by PHP ? To see all the extensions loaded by PHP, firstly we must be sure that PHP is successfully installed in our system. After that, we can use any of the following approaches to see the loaded extension list. Approach 1: In this approach, we will use command line to check all the loaded PHP extensions. O 1 min read PHP trait_exists() Function PHP implements a way to reuse code called Traits. The trait_exists() function in PHP is an inbuilt function that is used to check whether a trait exists or not. This function accepts the traitname and autoload as parameters and returns true if trait exists, false if not, null in case of an error. Sy 2 min read How to xdebug var_dump to display full object/array ? Debugging is necessary as committal to writing within the field of development. There would possibly occur a case once the developer must check data of a variable. A developer could print all the contents however PHP itself provides a way to try and do constant and similarly as checks the datatype. 2 min read PHP | Magic Constants Magic constants in PHP are special built-in constants that provide information about the current state of the script, such as the file name, line number, function name, class name, and more. They always start and end with double underscores (__) and are automatically used in by PHP.Their values chan 4 min read Print PHP Call Stack Given a PHP code and task is to print call stack for this PHP code. In the given PHP code, a child_func() function calls parent_func() function which further calls grandparent_func() function resulting in a call stack. Approach 1: Print the call stack using debug_print_backtrace() function. Example: 2 min read Like