Hey
let's Start
Variables in PHP
Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive, so $myvar is different from $myVar.
A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
Example :
PHP Superglobals
Superglobals are variables that available anywhere in the program code. They are :
$_SERVERVariables set by the web server or otherwise directly related to the execution environment of the current script. One useful variable is $_SERVER['REMOTE_ADDR'] which you can use to know you website visitor's IP address
Variable Scope
The scope of a variable is the context within which it is defined. Basically you can not access a variable which is defined in different scope.
The script below will not produce any output because the function Test() declares no $a variable. The echo statement looks for a local version of the $a variable, and it has not been assigned a value within this scope. Depending on error_reporting value in php.ini the script below will print nothing or issue an error message.
Have a nice day
Thursday, November 29, 2007
PHP ...Lesson Three
Posted by
AbuNada
at
9:59 PM
Labels: PHP Lessons
Subscribe to:
Post Comments (Atom)
Search
Categories
- About Jordan (4)
- Business News (42)
- Finance (14)
- Free (1)
- Funny (6)
- Games (1)
- General (25)
- HEALTH (4)
- Investments (12)
- Make Money (9)
- Other (7)
- PHP Lessons (7)
- Politics (1)
- Technology (7)
- Toursim (4)
- WaysToCash News (7)
Labels
- About Jordan (4)
- Business News (42)
- Finance (14)
- Free (1)
- Funny (6)
- Games (1)
- General (25)
- HEALTH (4)
- Investments (12)
- Make Money (9)
- Other (7)
- PHP Lessons (7)
- Politics (1)
- Technology (7)
- Toursim (4)
- WaysToCash News (7)
0 comments:
Post a Comment