PHP Function

Description

A function is a self contained block of code that performs a specific task.

Parameter

A function often accepts one or more arguments, which are values passed to the function by the code that calls it.

The function can then read and work on those arguments.

Return

A function may optionally return a value that can then be read by the calling code.

In this way, the calling code can communicate with the function.

Why

Functions avoid duplicating code. They make it easier to eliminate errors.

Functions can be reused in other scripts. They help you break down a big project.





















Home »
  PHP Tutorial »
    Language Basic »




PHP Introduction
PHP Operators
PHP Statements
Variable
PHP Function Create
Exception
PHP Class Definition