Thursday, July 2, 2009

php-1

;
\"
// /*
1.$ The variable name cannot begin with a numeric character, but it can contain numbers and the underscore character (_).
2.two main types of variables in your PHP code: scalar and array. Scalar variables contain only one value at a time, and arrays contain a list of values or even another array.
3.assign a value to a variable, you usually assign a value of one of the following types: Integers, Floating-point numbers ("floats" or "doubles"), Strings. Text or numeric information, specified within double quotes (" ") or single quotes (' ').
4.Variables can be local or global, the difference having to do with their definition and use by the programmer and where they appear in the context of the scripts you are creating.
5.a set of predefined variables is available to you. Some of these predefined variables are called superglobals, meaning that they are always present and available to all of your scripts, without any intervention by you, the programmer.
$_GET contains any variables provided to a script through the GET method.
$_POST contains any variables provided to a script through the POST method.
$_COOKIE contains any variables provided to a script through a cookie.
$_FILES contains any variables provided to a script through file uploads.
$_ENV contains any variables provided to a script as part of the server environment.
$_SESSION contains any variables that are registered in a session.
6.A constant is an identifier for a value that cannot change during the course of a script.
Unlike simple variables, constants do not have a dollar sign before their name, and they are usually uppercase to show their difference from a scalar variable.
define("MYCONSTANT", "This is a test of defining constants.");
predefined constant variables:
__FILE__ The name of the script file being parsed.
__LINE__ The number of the line in the script being parsed.
PHP_VERSION The version of PHP in use.
PHP_OS The operating system using PHP.

No comments:

Post a Comment