In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
PHP checks what methods are available for functions. In view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
When we use PHP for actual coding, we will definitely use functions, but how can we solve the problem that this function is a good enough test? Let's take a specific look at the methods and techniques available for PHP checking functions.
The PHP check function is available 1. 0. Get all available modules-get_loaded_extensions
This function returns all loaded (available) modules.
Usage:
Print_r (get_loaded_extensions ())
The PHP check function is available for 2. 0. Get the available function of the specified module-get_extension_funcs
This function returns all the functions available for the specified module. The parameter passed in (module name) must be lowercase
Usage:
Print_r (get_extension_funcs ("gd"))
The PHP check function is available 3. 0. Get all defined functions-get_defined_functions
This function returns all defined functions, including built-in functions and user-defined functions.
Usage:
Function myrow ($id, $data) {return "$id$data\ n";} $arr = get_defined_functions (); print_r ($arr)
Output:
Array ([internal] = > zend_version [1] = > func_num_args [2] = > func_get_arg [3] = > func_get_args [4] = > strlen [5] = > strcmp [6] = > strncmp. [7505] = > bcscale [751] = > bccomp) [user] = > Array ([0] = > myrow))
Where $arr ["internal"] is a built-in function and $arr ["user"] is a user-defined function.
The PHP check function is available in 4. 0. Check whether the specified function exists-function_exists
This function returns whether the specified function has been defined.
Usage:
If (function_exists ('imap_open')) {echo "IMAP functions are available.\ n";} else {echo "IMAP functions are not available.\ n"; this is the answer to the question about what is available for PHP checking functions. I hope the above content can be of some help to everyone. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.