06-variables/index.php File Reference

This program is used to demonstrate various types of PHP variables and how they are assigned and used. More...

Go to the source code of this file.

Functions

 main ()
 This function outputs various values of variables to demonstrate usage of variables, arrays, scope of variables in PHP.

Variables

 $global1 = 'This is global'
 This variable is declared just to demonstrate that global variables can be accessed in function by declaring them as global.
 $global2 = 'This is global too'
 This variable is declared to show that we cannot use global variables unless they are declared using global keyword.


Detailed Description

This program is used to demonstrate various types of PHP variables and how they are assigned and used.

Author:
Saurabh Barjatiya
Version:
1.0

Definition in file index.php.


Function Documentation

main (  ) 

This function outputs various values of variables to demonstrate usage of variables, arrays, scope of variables in PHP.

Returns:
Nothing

Definition at line 30 of file index.php.

References $global1, and $global2.


Variable Documentation

$global1 = 'This is global'

This variable is declared just to demonstrate that global variables can be accessed in function by declaring them as global.

Definition at line 14 of file index.php.

Referenced by main().

$global2 = 'This is global too'

This variable is declared to show that we cannot use global variables unless they are declared using global keyword.

Any attempt of using global variables unless declared so would simply affect local variable with same name.

Definition at line 22 of file index.php.

Referenced by main().


Generated on Fri Nov 4 14:16:54 2011 for PHP example documentation by  doxygen 1.4.7