This is one of the most used php code in the php language. The php functions come with a various use. There are around 1000 built-in functions available in php. You can even create your own user define a function to use.
Example
[php]<?php
function mddir() {
echo "Hello world!";
}
mddir();
?>[/php]
The above script is an example of a user-defined function. The word “function” is the essential started word. Without this php script will not recognize the function. The next is the name of the function. In our case, we have used our website name “mddir” to define the name of the function. This is called user define function name. You can change this as you want. Then in the curly bracket, we are asking php script to run the echo statement. The echo statement is executed after the closing curly bracket where we ask script to present the code.
The above function will present the below result.
Hello world!