PHP Functions

PHP functions are block of code defined to perform a specific task. PHP functions are like other programming languages. A function is a block of code which can takes one more input in the form of arguments and perform some processing and may or may not returns a value.

Syntax for Creating function in PHP :

Example1:

Example2:

Function with one parameter

Example2:
Function with parameter with default value