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.
Syntex of PHP function :
function functionName()
{
code to be executed;
}
Complete Example of PHP Function
[html]<!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>
[/html]
<?php
function star() //no parameter
{
for($i=1;$i<=40;$i++)
{
echo "*"; //no return value
}
echo"<br>";
}
star(); //function call but no argument
star();
?>
<?php
function reverse($num) //parameter receive
{
for($mod=0,$rev=0;$num>0;$num=(int)($num/10))
{
$mod=$num%10;
$rev=$rev*10+$mod;
}
echo "Out put in function"."<br>";
echo "Reverse=".$rev;
//function no return .
}
$number=365;
reverse($number); //argument passing
?>
I actually enjoyed reading through this posting.Many thanks.
Function Point Estimation Training
Thanks for your informative article on software testing. Your post helped me to understand the future and career prospects in software testing. Keep on updating your blog with such awesome article. Software testing training
Nice information about the load testing!!! I prefer Loadrunner automation testing tool to validate the performance of software application/system under actual load. Loadrunner training institute in Chennai | Loadrunner course in Chennai
Valuable information thanks for sharing Loadrunner Online Training
I have read your blog its very attractive and impressive. I like it your blog.
PHP Training in chennai | PHP Training Course
PHP Training in chennai | Online PHP Course
I learned new concept. Thanks for sharing.
seo training center in chennai
Thanks for your informative article on software testing.
best oracle training institute
Nice information thanks for posting PHP Training in chennai
There is no doubt in your post. I am really enjoying your services. It give so much beneficial information to every PHP developers.
Wonderful post..Keep updating..
very nice direction for writing blog content. I am new to blog writing, so this information had helped me a lot.
Thanks for sharing PHP function code. Its very useful for beginners in PHP.
great source of information
good information ,and thanks for sharing
I have read your blog it is very wonderful and impressive. I like your blog. It gives so much ideas information to every developer.