Monday, 22 October 2007

PHP Basic

A PHP scripting block always starts with . A PHP scripting block can be placed anywhere in the document.

On servers with shorthand support enabled you can start a scripting block with .

However, for maximum compatibility, you should use the standard form (
All variables in PHP start with a $ sign symbol.


In PHP a variable does not need to be declared before being set.

PHP automatically converts the variable to the correct data type, depending on how they are set.



A variable name must start with a letter or an underscore "_"
A variable name can only contain alpha-numeric characters and underscores (a-Z, 0-9, and _ )
A variable name should not contain spaces. If a variable name is more than one word, it should be separated with underscore ($my_string), or with capitalization ($myString

A string variable is used to store and manipulate a piece of text.



The concatenation operator (.) is used to put two string values together.

No comments: