PHP Basic Syntax
PHP scripts can be placed anywhere in the document;
PHP script to <? php to start with ? > end;
PHP files usually include HTML tags and some php script code;
Give me a chestnut:
1 2 3 4 5 6 7 <? 8echo "Hello world!" 9
View CodeIt is important to note that every sentence in PHP is ended. ; is a delimiter used to separate the instruction set. Echo and print are the basic instructions for outputting text in the browser.
PHP Variable rules:
- The variable starts with the $ sign, followed by the name of the variable
- Variable names must start with a letter or underscore character
- Variable names can contain only alphanumeric characters and underscores (A-Z, 0-9, and _)
- Variable names cannot contain spaces
- Variable names are case-sensitive ($y and $Y are two different variables)
Both the PHP statement and the PHP variable are case-sensitive.
PHP Learning Notes-1