PHP Data type: Data type in PHP

Source: Internet
Author: User
Tags array definition function definition functions variables require variable


Data type
PHP has only integers, floating-point numbers (or real numbers, double numbers), and string three basic data types. Strings are available in single and double quotes, but have different meanings: only within double quotes you can use variables.
Variable
The variables are preceded by "$", and the variables do not need to be described (or defined) in advance by the type of the variable, and different types of data can assign values to the same variable. However, to use global variables, you need to 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 object members). The "=>" operator is added to assign an initial value to an array. In addition, logic and ("&&") and Logic or ("") can also use "and" and "or" to increase the logical XOR or "XOR"
Basic statement
Requires mastery of if-else statements, switch-case statements, for statements, while statements, do-while statements, continue statements, and break statements. Require statements and include statements for inserting a disk file
Definition and use of functions
You do not need to specify function types and parameter types by using function definition functions.
Function name (parameter 1, parameter 2, ...). )
{Statement 1;
Statement 2; .....
}
This article links http://www.cxybl.com/html/wlbc/Php/20130101/35451.html

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.