Home  >  Article  >  Backend Development  >  Naming rules for php function names

Naming rules for php function names

藏色散人
藏色散人Original
2019-10-21 10:04:176418browse

Naming rules for php function names

Naming rules for php function names

Functions are functions. Encapsulate a piece of code that performs a specific function. Calling a function is calling a function. ,

Basic syntax format of function

function 函数名([参数1, 参数2, ……]){
    函数体……
}

function: Keywords that must be used when declaring a function

Function name: It must conform to the PHP identifier, and the function name is Unique, case-insensitive

[Parameter 1, Parameter 2...]: The value passed to the function from the outside world. It is optional. Use commas "," to separate multiple parameters.

Function body: The main body of the function definition, a code segment specifically used to implement specific functions.

Return value: You need to use the return keyword to pass the data that needs to be returned to the caller.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of Naming rules for php function names. 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