Advertisements
Advertisements
प्रश्न
Discuss in detail about User define Functions with a suitable example.
थोडक्यात उत्तर
Advertisements
उत्तर
- User-Defined Function (UDF) in PHP gives a privilege to user to write own specific operation inside of existing program module.
- Two important steps the Programmer has to create for users define Functions are:
Function Declaration
- A user-defined function declaration begins with the keyword “function”.
- User can write any custom logic inside the function block.
Syntax:
function functionName()
{
Custom Logic code to be executed;
}
Function Calling:
- A function declaration part will be executed by a ! call to the function.
- A programmer has to create Function Calling part j inside the respective program.
Syntax:
functionName();
Example:
<?php
function insertMsg() {
echo “Student Details Inserted Successfully!”;
}
insertMsg(); // call the function
?>shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
