PHP Manual-Language Reference-type

Source: Internet
Author: User

PHP supports raw data types in 8: Boolean | Integer | float | string | Array | Object | Resource | Null

1.4 Types of scalar data

1.1 Boolean Boolean type

1.2 Integer integer type

1.3 Float | Double floating point type

1.4 String Strings

2.2 Types of data compliance

2.1 Array Arrays

2.2 Object Objects

3.2 Special types

3.1 Resource Resources

3.2 NULL No type

Pseudo type: Mixed mixed type | Number Numeric Type | Callback Callback Type

Pseudo variable: $

The type of the variable is determined by the context in which PHP is used based on the variable.

void Var_dump (Mixed $expression [, $ ...]);

If you want to see the value and type of an expression, use the var_dump () function--to print information about the variable, to display the structure information about one or more expressions, including the type and value of the expression. The array recursively expands the value and displays its structure by indentation.

String GetType (mixed $var);

If you just want a readable type of expression for debugging, use the GetType () function--to get the type of the variable.

BOOL Is_array (mixed $var);

If you want to see a type with the is_* function: Is_array () | Is_bool () | Is_float () | Is_integer () | Is_null () | Is_number () | Is_object () | Is_resource () | Is_scalar () | Is_string ()-- detects the variable type .

BOOL Settype (mixed $var, string $type);

If you want to cast a variable to a type, you can use the settype () function--to set the type of the variable .

PHP Manual-language Reference-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.