Copy CodeThe code is as follows:
Reference
$one = "Test";
two=& $one;//equivalent to address, two variables point to an address
Dynamic variables
$one = "######";
$two = "one";
$three = "both";
echo $three. "
";//Output" "
echo $ $three. "
";//Output" one "
echo $$ $three. "
";//Output" ###### "
There are 8 types in PHP
4 scalar types: int integer
BOOL Boolean
Float,double,real
String
2 Composite types: Array
Object
2 Special types: Resource type Resource
Empty type null
Declaration of integers
$int = 10; Decimal declaration
$int =045;//Octal statement
$int =0xff;//Hex Declaration
$float =3.14e+5;//Scientific Counting method
$float =3.14e-5;
It's all a false case.
$bool =false;
$bool = 0;
$bool = 0.000;
$bool =null;
$bool = "";
$bool = "";
$bool = "0";
$bool =array ();
Declaration of a string
1. Both single and double quotation marks can declare a string
2. The declared string has no length limitation
3. In a double-quoted string, you can either parse the variable directly, or you can use the escape character directly (you can escape the single quotation mark itself, or you can escape the escape character "\")
4. In a single-quoted string, you cannot parse the variable directly or use an escape character
5. Double quotes are no longer used in double quotes, and single quotation marks are no longer used in single quotes
6. It is best to use single quotes,
$str = ' AAAAA ';
$str = "AAAA";
Delimiter declaration string, large number of strings
Test is a custom string that cannot be followed by any characters, and spaces cannot be
Also ends with a custom string of test, which cannot have any characters before the end.
$str =<< This write content ...
Test;
?>
http://www.bkjia.com/phpjc/323473.html www.bkjia.com True http://www.bkjia.com/phpjc/323473.html techarticle Copy code code as follows:? PHP//reference $ one= "Test"; two= $one;//equivalent to address, two variables point to an address//dynamic variable $one = "######"; $two = "one"; $three = "both"; Echo $t ...