What does the {} curly brace mean in PHP _php tutorial

Source: Internet
Author: User
1. {} indicates the start and end of the block

For example

Copy the Code code as follows:
if ($x = = $y)
{
Do_nothing ();
}


2. {} is used to denote a string subscript

For example
(quoting the words of Longnetpro Brothers)
The $s {1} represents the 2nd byte of the string $s (not the first), which is basically equivalent to $s[1], except that the latter is the old one, and the PHP manual recommends the first www.444p.com all rights reserved.

3. Separating variables

For example

Copy the Code code as follows:
$s = "Di,";
Echo ("${s}omething");
Output:di, omething

And if you use Echo ("$something");
Then it will output $something this variable.

http://www.bkjia.com/PHPjc/621708.html www.bkjia.com true http://www.bkjia.com/PHPjc/621708.html techarticle 1. {} indicates the beginning and end of the block such as copy code code as follows: if ($x = = $y) {do_nothing ();} 2, {} is used to denote string subscripts such as (referring to Longnetpro Brothers) $ ...

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