Types of functions in php:Function with no arguments and no return values.
Function with no arguments and with return values.
Function with arguments and no return values.
Function with arguments and return values.
Function with no arguments and no return values.<html>
<body>
<?php
function add()
{
$a=10;
$b=20;
Echo $a+$b;
}
add();
?>
Function with no arguments and with return values.<html>
<body>
<?php
function add()
{
$x=10;
$y=20;
$total=$x+$y;
return $total;
}
$a=add();
echo $a;
?>
Function with arguments and no return values.<html>
<body>
<?php
function add($x,$y)
{
$total=$x+$y;
echo $total;
}
add(10,10);
?>
Function with arguments and return values.<html>
<body>
<?php
function add($x,$y)
{
$total=$x+$y;
return $total;
}
echo . add(10,10);
?>
--------------------
Visit Us At:
http://www.cegonsoft.comcegonsoft