Home  >  Article  >  Backend Development  >  How to determine whether a function is defined in PHP

How to determine whether a function is defined in PHP

王林
王林Original
2019-11-13 17:50:233037browse

How to determine whether a function is defined in PHP

1. Declare the file type and encoding for PHP interaction with the browser, as shown in the figure:

How to determine whether a function is defined in PHP

2. function_exists( ) Function of the function: If the function has been defined, it returns TRUE. The syntax structure is as shown in the figure:

How to determine whether a function is defined in PHP

3. Use the function_exists() function to determine whether the show() function has been is defined, the code is as shown in the figure:

How to determine whether a function is defined in PHP

Run the web page, output the judgment result of the function_exists() function, and display the result as shown in the figure:

How to determine whether a function is defined in PHP

Recommended tutorial: PHP tutorial

The above is the detailed content of How to determine whether a function is defined in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:NodeJs and PHP benchmarkNext article:NodeJs and PHP benchmark