Manual of PHP

 
 
 

Web map

 
rim   rim
Carriedarrow Functions in PHP

 

Functions in PHP To print E-mail

One of the most important hardware in any computer language there are the functions. A function consists of a set of routines and actions that along the script multitude of times is going to be executed grouped in a FUNCTION and from any point of the script it can be called and executed. In turn, this function can receive external parameters on which the result of a function depends.

The functions must always be placed before realizing the call to the function (as it is logical). The syntax of a function is the following one:

function name (parameters) {
  instructions of the function
}

to call to the function it would perform the following form: name (parameters)

An example to understand the use of functions is the following one:
We will create a function that realizes the sum of two numbers and shows the result

function to add up ($sumando1,$sumando2) {
 $ suma=$sumando1+$sumando2
I begin $sumando1." + ". $sumando2." = ". $suma;
}

to add (5,6)

An excellent fact that it is necessary to emphasize is that the variables that we declare inside the function alone will exist or have the above mentioned value inside the function.

There exist cases in which we do not know the number of parameters that we will spend to him to the function and in these cases we must use the functions created to the effect as they are:

func_num_args () I Number of parameters that have passed to the function
func_get_args () He Returns an element of those who form the list of arguments

Previous chapter:
Structures of Control

Following chapter:
Code inclusion from a file



 

 
Front
Chapters of the Manual of PHP
Introduction to PHP
Variables
My First Script PHP
Operators in PHP
Structures of Control
Functions in PHP
Code inclusion
Counterfoils (array)
Chains of Characters
Classes
Dates
Entry and Exit
Operations with Files
The language SQL and PHP
Connection with MySQL
Meetings
Forms with PHP
To practise in line
List of practices in line
FAQ
Frequent questions
Codes PHP
List of Codes PHP
Forums
Forums PHP
Other Manuals
Manuals of other languages
 
   
 
 
MySpaceScripts.info - Sitemap - Contact us - Sitemap - Contact us - Sitemap - Contact us

Replika Klockor , Sri Sri Ravi Shankar , incoming tour operator poland , Website designer Dublin , Incentive Travel Poland , cars.moto-point.co.uk , Kiteboarding