1. Computing & Technology

Discuss in my forum

How to create a function in PHP

By , About.com Guide

Definition: PHP has many functions predefined, but often you will be using functions that you create yourself. Creating a function is very easy, here is how:
function FunctionName()
{
code to execute;
}
First you define the function name, and then what the function will do. Here is an example:
function examplefunction () 	
{ 	
print "Hi, I'm a Function 
"; }

©2012 About.com. All rights reserved.

A part of The New York Times Company.