Home > Backend Development > PHP Tutorial > Constants basics PHP basic learning the use of variables

Constants basics PHP basic learning the use of variables

WBOY
Release: 2016-07-29 08:45:32
Original
1323 people have browsed it

Copy code The code is as follows:


//Quote
$
echo $$three."
";//Output "one"
echo $$$three."
";//Output "######"
//There are 8 types in php
//4 kinds of scalars: int integer
// bool boolean
// float, double, real
/ / string
//2 composite types: array
// object
//2 special types: resource type resource
// empty type null
//declaration of integer
$int=10; //declaration of decimal
$ int=045;//Octal declaration
$int=0xff;//Hexadecimal declaration
$float=3.14E+5;//Scientific notation
$float=3.14E-5;
//All of them In the case of false
$bool=false;
$bool=0;
$bool=0.000;
$bool=null;
$bool="";
$bool=" ";
$bool="0";
$bool=array();
//Declaration of strings
//1. Both single quotes and double quotes can declare strings
//2. There is no length limit for the declared strings
//3. In double quotes In a string, variables can be parsed directly, or escape characters can be used directly (the single quote itself can be escaped, or the escape character "" can be escaped)
//4. In a string with single quotes, it is not possible Directly parse variables, and escape characters cannot be used
//5. Double quotes cannot be used within double quotes, and single quotes cannot be used within single quotes
//6. It is best to use single quotes,
$str= 'aaaaa';
$str="aaaa";
//Delimiter declares a string, a large number of strings
//test is a customized string, there cannot be any characters after it, and spaces are not allowed either
// It must also end with the custom string test. There cannot be any characters before the end.
$str=<<this write content...
test;
>

The above introduces the use of variables in Constants basic PHP basic learning, including the basic aspects of Constants. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template