PHP parser: braces around variables

后端 未结 3 1370
清酒与你
清酒与你 2021-01-05 13:30

I was wondering, how is the semantics of braces exactly defined inside PHP? For instance, suppose we have defined:

$a = \"foo\";

then what

3条回答
  •  情深已故
    2021-01-05 14:11

    Also you can use braces to get Char in the position $i of string $text:

    $i=2;
    $text="safi";

    echo $text{$i}; // f

提交回复
热议问题