1. Computing

Discuss in my forum

Function

By , About.com Guide

Definition: A function is like a subroutine. It is a predefined set of commands that are executed when the function is called. Functions can be as simple or complex as desired, and can contain other functions within themselves. In the case of PHP, some functions come preprogramed and others you can define on your own.
Examples:
 <?
 SQRT (9); 
 // this function is predefined in PHP and performs the mathematical computation of square root. In this case would output the number 3 

function examplefunction () //defining a function { print "Hi, I am a Function"; } examplefunction (); //calling a function // this function simply prints Hi, I am a Function when called ?>

Related Video
Excel Autosum Function
Basic PHP Syntax
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Programing Glossary
  5. php function - function in php - php string function

©2013 About.com. All rights reserved.