TOP TECH
  Learn How to.....
Welcome IT Related Articles Member Area  |  Sign In  |  Sign Up
.: Home :.
General
HTML
CSS
PHP
PHP-MySQL
FrontPage
Photoshop
CorelDRAW
PageMaker
MS Office
VisualBasic
All
.

.: Home :.

Home >> PHP - MySQL
Creasting Dynamic Web Sites 3.1 [Page 4]
Article by: Shelton Manage
Tuesday, 09th June, 2009


Variable Scope

 

variable scope is a tricky but important concept. Every vsariable in PHP has a scope to it. To alter the variable scop within a function, you can use the global statement.

function function_name() {
global $var;
}
$var = 'value';

Another option for circumventing variable scope is to make use of the superglobals. $_GET, $_POST, $_SESSION, etc. These variables are automatically accessible within your functions.

To use superglobal variables:

Open handle_calculator.php and change the function definition line, for check this action tempararaly inseret 2 for form action to calculator.php

handle_calculator2.phps | handle_calculator2.php



Page: First - 1 2 3 4 - Last

 



Comments


© 2009 Top Sri Lanka Top Tech.
Articles Manager β - Script by: DynamicCodes.com