Step by step learning the PHP (2) PHP type

Source: Internet
Author: User
The PHP type is case sensitive. 1. case sensitivity
PHP built-in functions and structures are case-insensitive.
For example:
The code is as follows:


HelloPHP


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



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

The code is as follows:


HelloPHP


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



However, variables are case sensitive.

2. variables
Only one sentence can be mentioned here. even those who have been slightly touched by PHP will know that the PHP declaration variable starts with the dollar sign ($.
In the previous example, we can also see that.
3. type judgment function
In PHP, there are eight data types: integer, floating point, string, Boolean, array, object, NULL, and resource type.
There is an important function for determining the type, in the format of is_XX.
For example:
The code is as follows:
$ IntTest = 1;
Echo (is_int ($ intTest ));
Echo ("
");
$ StringTest = "Test ";
Echo (is_string ($ stringTest ));
Echo ("
");
Echo (is_int ($ stringTest ));
?>

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.