Learning PHP Step-by-step learning php2--php Type

Source: Internet
Author: User
Tags learn php
1. About capitalization
PHP's built-in functions and structures are case-insensitive.
Such as:

Copy the Code code as follows:




hellophp


Echo ("Hello PHP");
ECHO ("Hello PHP");
Echo ("Hello PHP");
?>



The effect of these three is the same.
Other, user-defined class names and method names are also case insensitive.
For example:

Copy the Code code as follows:




hellophp


function Test ()
{
Echo ("Hello PHP");
}
Test ();
TEST ();
Test ();
?>



However, the variables are case-sensitive.

2. Variables
One thing to mention here is that even a little bit of PHP will know that PHP declaration variables start with a dollar ($) symbol.
In the previous example, we can also see.
3. Type judgment function
In PHP, there are eight types of data: integer, Float, String, Boolean, array, object, NULL, and resource type.
There is a very important function for judging the type, in the form of is_xx.
For example:

Copy the Code code as follows:


$intTest = 1;
Echo (Is_int ($intTest));
Echo ("
");
$stringTest = "Test";
Echo (Is_string ($stringTest));
Echo ("
");
Echo (Is_int ($stringTest));
?>

The above is introduced to learn PHP step-by-step learning php2--php type, including the content of learning PHP, I hope the PHP tutorial interested in a friend helpful.

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