Home > Article > Backend Development > 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!