Home > Article > Backend Development > What are the two types of php functions?
#php functions are divided into two types: built-in functions and custom functions.
Recommended reading: php server
##Built-in functions
So-called PHP built-in functions are functions that have been defined in the library of the PHP program, such as echo, mysql_connect, include_once, etc., just like the system functions in VC, such as cout, etc. In PHP, more than 1,000 built-in functions are provided.Custom functions
In addition to the built-in PHP functions, we can create our own functions.function functionname(){ 被执行的代码; }Note: Function names can start with letters or underscores (not numbers). Function names are not case sensitive. Tip: The function name should reflect the task performed by the function. Example:We create a function named "shili()". An opening brace ({) indicates the beginning of a function's code, while a closing brace (}) indicates the end of the function. This function outputs "Hello world!". To call this function, just use the function name:
<?php function shili() { each"hello world!"; } shili(); ?>Output:
hello world!
The above is the detailed content of What are the two types of php functions?. For more information, please follow other related articles on the PHP Chinese website!