click here to open sidebar
PHP Function – PHP has already made more than thousand of function.
You can create your own function manualy.
PHP has pre build fuction but you can create your function with logic.
A user-defined function declaration starts with the word function
Now we can create myFunction(), then ({) bracket are indicate the start the function code and (}) indicate close the function code.
After complete the code call the function.
User Defined Function
An argument like is variable.
Pass the argument value to the function.
An argument passed inside the function name as a variable.
All argument value passed after the variable declare.
Below example: we have declare function with argument variable ($cname). Then declare the all argument value inside the function name.
PHP Function Arguments
";
}
carName("Toyota");
carName("Honda");
carName("Verna");
carName("Versa");
carName("Oddi");
?>