Home > Article > Backend Development > PHP determines whether the function exists
PHP determines whether the function exists
1. Create a new file
2. Enter the structure of the php web page (), as shown in the figure Shown:
3. Declare the file type and encoding for PHP interaction with the browser, As shown in the figure:
4. Function_exists() Function: If the function has been defined, it returns TRUE. The syntax structure is as shown in the figure:
5. Use the function_exists() function to determine whether the show() function has been defined. The code is as shown in the figure:
6. Run the web page and output the judgment result of the function_exists() function. The displayed result is as shown in the figure:
Note:
When When this configuration or compilation or compilation option disables a function, the function name may also exist (image is a ready-made example)
Recommended tutorial: PHP video tutorial
The above is the detailed content of PHP determines whether the function exists. For more information, please follow other related articles on the PHP Chinese website!