Data type
JS in two major categories
Basic data types
???? Number
???? String
???? Boolean
???? Undefined
???? Null
Composite data types
???? Array
???? Object
???? function
?
PHP Data types fall into three main categories
Scalar data types
???? Int/integer???? Integer
???? Float (fractional)
???? String strings
???? Boolean
Composite data types
???? Array
???? Object Employment Class Speaking
Special data types
???? Resource (resources)
???? Null
?
String data type:
Defined
Syntax 1:
???? Use single quotation marks to define
Description
???? Single quotation marks can be escaped in a string defined by \ ' \ \
???? The value of a variable in a string defined by single quotation marks cannot be resolved
Syntax 2:
???? Use double quotation marks to define
Description
???? A string literal that is defined by double quotation marks can be implemented
???? The value of a variable in a string defined by double quotation marks can be parsed
???? When parsing variable values in a string, it is sometimes necessary to use "{}" to define variables.
Example:
Syntax 3:
???? Using delimiters
Example:
Description
???? The beginning of the delimiter is consistent with the end tag
???? Cannot have any characters (including whitespace) before the closing tag
?
Translation characters in PHP (\)
Role:
???? 1. Enter characters that cannot be entered through the keyboard
???? 2. Enter characters with special tools that have been defined by PHP
\ n???????? Line break
\ t???????? tab character (tab)
\ r???????? Enter
\$???????? $
\\????????
Resource Resources
???? Resources in PHP are also a special variable, using PHP's header data type (string, data value, Boolean) data can not be used to establish resources, you must use PHP to provide us with a dedicated to the operation of the resources of the function to establish a connection to the resource.
Example:
PHP data type