PHP data type

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.