Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but wonβt spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
Functions are used to make the programming very easy .The code is written once in the function and whenever the code is required, the function is called by its name instead of writing the whole code again. This is the benift of using function.
in other word we can say, A Function is a reusable piece or block of code that performs a particular action. It takes input from the user in the form of parameters, performs certain actions, and gives the output.
There are two types o function :-
- Build in function
- User defined function
Build in function
Built in functions are predefined functions in PHP that exist in the installation package of php
ex:-

User defined function
User-defined functions are those that are not available in the system. In user defined functions, the user can create the functions according to task perform. While the built-in functions have readymade functionality, you have to use the function. User Defined functions have also a lot of benefits.
SYNTAX
function functionName(){
code will be executed ;
}
ex :-
