PHP Entry Variable _php tutorial

Source: Internet
Author: User
A variable is a container for temporarily storing values. These values can be numbers, text, or much more complex data.

PHP has 8 kinds of variables.

These include 4 scalar (single-valued) types-string (character), Integer, floating-point (decimal), and Boolean (true or false);

Two non-scalar (multi-valued) types-arrays and objects, and resources (which you will see when interacting with the database) and null (it is a special type that does not have any values).

============================================================================

PHP Syntax Rules:
1, the name of the variable-also known as its identifier-must start with a dollar sign ($), for example, $name.
2. Variable names can contain combinations of letters, numbers, and underscores, for example, $my _report1.
3. The first character after the dollar sign must be either a letter or an underscore (not a number).
4. The variable names in PHP are case-sensitive. This is a very important rule. This means that $name and $name are distinct variables.

FAQ:

First, you can assign a value to a variable by using the equals sign (=) (also known as the assignment operator).

Second, you can print the variable without quotation marks, or you may print the variable in double quotation marks, but you cannot print the variable within single quotation marks.

 
  

============================================================================

"1" The most important consideration when creating variables is to use a consistent naming pattern. Some programmers prefer to use variable names all with lowercase letters, and use underscores to separate words ($first _name); some programmers prefer to use the first capital letters, for example: $FirstName (that is, camel-like spelling).
< span="">

http://www.bkjia.com/PHPjc/742587.html www.bkjia.com true http://www.bkjia.com/PHPjc/742587.html techarticle A variable is a container for temporarily storing values. These values can be numbers, text, or much more complex data. PHP has 8 kinds of variables. These include 4 scalar (single-valued) type characters ...

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