<?php
class T{
public $name;
public function __construct($name){
$this->name="$name";
}
}
$arr=["a"=>"A","b"=>"B"];
$temp=new T("allen");
echo "$temp->name";
echo "$arr[b]";
// echo "$arr['b']"; //syntax error
// echo $arr[b]; // will give Notice: undefined constant b
?>
PHP 双引号内的对象和数组
最新推荐文章于 2022-11-08 22:31:08 发布