[PHP] 测试模块是否加载

开发时遇到叫用函数 错误.
可能原因应该是dll未加载.
这边可以使用 方法测试. 
get_extension_funcs

官方说明如下:
http://php.net/manual/en/function.get-extension-funcs.php


function testGD(){
	$testGD = get_extension_funcs("gd"); // Grab function list 
	if (!$testGD){ echo "GD not even installed."; exit; }
	echo"
".print_r($testGD,true)."
"; }

若未加载, 会输出 GD not even installed.

这是官方的范例:

会输出如下内容.

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
)