Types of functions in php | php tutorial

  • 3 Replies
  • 1413 Views
*

Sharmait007

  • Newbie
  • *
  • 8
  • +0/-0
    • View Profile
Types of functions in php | php tutorial
« on: September 19, 2011, 07:30:29 AM »
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);
?>
« Last Edit: September 19, 2011, 08:40:53 AM by Webhelpforums »

*

Quickgun12

  • Newbie
  • *
  • 4
  • +0/-0
    • View Profile
Types of functions in php | php tutorial
« Reply #1 on: September 23, 2011, 05:47:09 AM »
Hi Sharma....The above PHP function types concepts was very nice.....

The concepts was really very useful for me  and all the PHP developers....

Thanks for your helpful information....

« Last Edit: September 23, 2011, 06:54:30 AM by Webhelpforums »

*

jordanhustin

  • Newbie
  • *
  • 16
  • +0/-0
    • View Profile
Re: Types of functions in php | php tutorial
« Reply #2 on: December 28, 2011, 06:39:19 AM »
I want to learn php.can you tell me the best website to learn php online?

*

lillianabe

  • Full Member
  • ***
  • 182
  • +0/-0
    • View Profile
Re: Types of functions in php | php tutorial
« Reply #3 on: January 27, 2012, 01:57:39 AM »
Now days in PHP programming, developer prefer to use scripts which are easily available to develop basic functionality to save the time. Understanding of function is require to create custom requirement and it is necessary to know how to pass the argument and how to calculate the value in argument. 

 




See Our Webmaster Tools for Windows and Mac

A1 Sitemap Generator
      
A1 Website Analyzer
      
A1 Keyword Research
      
A1 Website Download
      
A1 Website Search Engine
      
A1 Website Scraper