Data types in PHP _php tutorial

Source: Internet
Author: User
Data type

PHP has only integers, floating-point numbers (or real number, double-precision numbers), and three basic data types of strings. Strings are available in single and double quotes, but have different meanings: only double quotes can use variables.

Variable

The variable is preceded by a "$", which uses a variable without having to specify (or define) the type of the variable beforehand, and different types of data can assign values to the same variable. However, to use global variables, you must specify (or add them to the $globals[] array). Use static variables to describe them.

Array

Using an array does not require a description of its type and size and can be used directly. The elements of the same array can have different data types.

Operator

The C-language operator is largely preserved. Added string connector "." (use "," when accessing an object member.) Added the "= =" operator to assign an initial value to the array. In addition, logic with ("&&") and Logic or ("| |") Also available with "and" and "or", adding a logical XOR or "XOR"

Basic statement

Requires mastering If-else statements, switch-case statements, for statements, while statements, do-while statements, continue statements, break statements. Require statements and include statements for inserting a disk file

Definition and use of functions

Using function to define functions, you do not need to describe function types and parameter types.

Function name (parameter 1, parameter 2, ...). )

{Statement 1;

Statement 2;..

}

Excerpt from bing7599069 's column

http://www.bkjia.com/PHPjc/478486.html www.bkjia.com true http://www.bkjia.com/PHPjc/478486.html techarticle data type PHP has only integers, floating-point numbers (or real number, double-precision numbers), and three basic data types of strings. Strings are available in single and double quotes, but with different meanings: only ...

  • 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.