What is PHP Function?
PHP Function is a set of statements that perform a specific task. A function usually takes input arguments, perform a specific action on them and returns the result.
Example of function in PHP:
<?php
function msg() { //function function name
echo "Hello world!";
}
msg(); //call to function
?>
Learn more about the similar topics:
Tutorials |
---|
PHP Functions |
Exercises & Assignments |
---|
Factorial program in PHP using recursive function |
Write a PHP program to check if a person is eligible to vote |
Write a PHP program to calculate area of rectangle |
Interview Questions & Answers |
---|
What is PHP Function? |
What is PHP floor() function? |