PHP Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
PHP Topics
Introduction Introduction
Syntax Syntax
Data Types Data Types
Operators Operators
Control Structures Control Structures
Functions Functions
Pre-defined Function Pre-defined Function
Calendar Functions Calendar Functions
Date and Time Date and Time
Array Functions Array Functions
Array List Array Functions List1
Array Function List Array Functions List2
Math Functions Math Functions
PHP MYSQL Functions PHP Mysql Functions
File Handling File Handling
Error Handling Error Handling
DB Size DB Size
PHP Mail PHP Mail
String Tokens String Tokens
String Functions String Functions
String Functions List String Functions List1
String Functions List2 String Functions List2
Session Functions Session Functions
Cookies Functions Cookies Functions
Form Variables Form Variables
Running PHP from JS Running PHP from JS
Array To JS Array To JS
JS Array Array to PHP
Encryption Encryption
Common Header Common Header
Forums Ask Your Doubts
Scraps More about PHP
Feedback Feedback
 




PHP Custom Programming


Tutorials »Php »

Topic

What is Function?



Explanation

The authors of PHP extended it into a full-fledged programming language that can be used both for simple as well as for complex object-oriented programming.

Some of the useful features of PHP are its built-in functions. But PHP also allows you to write your own functions. The main advantage of custom functions is reuse. If you don't write functions, you may have to write the same piece of code numerous times in your application, whether it's within the same PHP file or in others.

Syntax:
    function functionName()
      {
       code to be executed;
      }
Example:
    function write()
     {
      echo "Sam  Anderson";
     }
    echo "My name is ";
    write();
Result:
    My name is Sam Anderson 

In the above example, the a function is called to print a string.






A Note

Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial. Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.

Other Links

web hosting