Home Tutorial Php Phparray Return Statement in PHP

 
 

Share on Google+Share on Google+
Return Statement in PHP
Posted on: August 29, 2009 at 12:00 AM
Advertisement
In this tutorial you will learn about Return Statement in PHP.

In PHP Return is a Statment that returns value back to the calling program. For example if the Return Statment is called from within a function it will end the excution on it(return statment) and will return the value or argument back to the function 
call. We can also see it with the help of given small addition example...

<?php

function add($a, $b)

{
$Addition=$a+$b;
return $Addition;
}

echo add(8, 96);

?>

In the above example there is a variable called Addition, that takes two different arguments and calls the functions. Function takes the value and find the addition of two arguments and then returs the value back to $Addition which is calling variable.

Output of return function call example

104

 

Advertisement

Related Tags for Return Statement in PHP:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 29, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com