In developing any application using functions is something primal, through them you can run code blocks apart and use them in various parts of the system. The main functions of the role is to ensure that there is a greater reuse of code, without its use would be necessary to implement the same code block every time it was needed. It is common to find validation functions, for example, to illustrate this scenario.
In PHP a function is declared from the syntax and function is written as follows:
<?php
function info(){
echo (“This is a PHP Function.”);
}
?>
The functions can also return certain information and still receive parameters for the actual processing of the data, as shown below:
<?php
function info($var1, $var2){
return $var1 + $var2;
}
?>
To call certain function in PHP, just write your name and send the parameters when necessary. Who is starting in the programming world need to understand well the operation of more that item as well as several others he is also part of the daily life of a programmer.
Learn PHP one of the most powerful tools in the market. Scriptcase has a section on the site dedicated just for those who want to learn, moreover, offers a free version of its tool for those who do not want to waste time. Download now Scriptcase and discover a world of advantages primarily focused on results.
Comment this post