Home >Backend Development >PHP Tutorial >PHP defines a parameter with default value function instance analysis_PHP tutorial
This article mainly introduces php to define a function with default values and analyzes the php parameters with examples. Friends who need tips on using functions with default values can refer to them
The example of this article analyzes the usage of PHP function that defines a parameter with a default value. Share it with everyone for your reference. The specific analysis is as follows:
PHP function parameters can specify default values. After specifying the default value, if you do not assign a value to the parameter when calling, the parameter will use the default value
?
3 4 5
|
function capitalize( $str, $each=TRUE ) { "); } capitalize("hEllo WoRld!"); capitalize("hEllo WoRld!",FALSE); ?> |