Functions in PHP

In this tutorial we will learn about Functions in PHP. Function is block of code which perform a specific task and which we can use multiple times without writing it again and again. For example you want to perform some mathematical task in your code several times. It mean you have to write same code to perform that mathematical task. But by using function you only have to write your mathematical task code once and you can use it any number of times.

Functions In PHP


Lets check how make and call a function in Program. To make function just write function name with () and then write body of function.

Example





Function with Parameter:

In call example we learn how to define and call a function in PHP. Here we will learn hoe to define and call functions with parameters. Sometimes we need data to process in function. so we send data to function while calling that functions. Check example below to understand it.

Example







Share this tutorial with your friends on your social Media..

Functions in PHP Functions in PHP Functions in PHP Functions in PHP



Now You Can Follow All These Tutorials on Your Android Mobile Just Download This App.


Owlbuddy.com