Lets enjoy power of PHP Function

Lets enjoy power of PHP Function

function():

A set of specific program and source code which complete a specific task is function.
Function separates the complexity of a large program and provides a
modular approach. There are two type of function user define function
and library function. Now focus on user defines function and try to
understand.

PHP Function

 

Syntex of PHP function :

function functionName()
{
code to be executed;
}

 

Complete Example of PHP Function

<!DOCTYPE html>
<html lang="en">
<head>
<title>IP Address</title>
<meta charset="utf-8" />
</head>
<body>
<?php
function crdt(){
$dt=date("m/D/Y");
return $dt;
}
echo crdt();
?>
</body>
</html>

14 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Do you have any Query / Suggestion