A simple php program to print hello world using function. This program will help you to understand how the function works in php programming language. PHP function is a chunk of code that can be reused numerous times. It can take input as argument list and return value. PHP comes with thousands of built-in functions. Conditional functions, Function within Functions, and Recursive functions can all be defined in PHP.
echo "Hello $name<br/>";
What is functions in php and how it works
Other programming languages‘ functions are similar to PHP’s. A function is a piece of code that takes another input in the form of a parameter, processes it, and then returns a value. Many functions, such as fopen() and fread(), have already been encountered. A feature that can be used by end users and is built into an application. Most spreadsheet programs, for example, provide a built-in SUM function that sums up all cells in a row or column.