PHP supports 8 basic data types

Source: Internet
Author: User

Boolean (Boolean): This is the simplest type, with only two values, which can be true/true or false/false, not case-sensitive. For more information, see: Php Boolean Type (Boolean)
Integer (integer): It has a valid range of 32-bit operating systems:-2 147 483 648~+2 147 483 647. Integer values can be expressed in decimal, hexadecimal, or octal, preceded by an optional symbol (-or +). Octal indicates that the number must be preceded by 0 (0), and hexadecimal indicates that the number must be preceded by 0x. For more information, see: PHP Integer data (integer)
Float (floating point, also called double): the valid range in a 32-bit operating system is: 1.7e-308~1.7e+308. For more information, see: PHP Floating-point type (float)
String: A character variable differs from another programming language in that it has characters and strings, and in PHP, a character variable is used uniformly to define a character or string. For more information, see: PHP String type

Two kinds of composite types:
Arrays (arrays): Array variables are a special type of variable, PHP array type (object)
Object: Objects are also a special type of data. To create an object variable, use the New keyword. For more information, see: PHP Object Type

Finally, there are two special types:
Resource (Resource): A source is a special variable that holds a reference to an external resource. Resources are created and used through specialized functions. For more information, see: PHP Resource Type (Resource)
Null (NULL): Indicates that a variable has no value. The only possible value for a null type is NULL.

PHP supports 8 basic data types

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.