php:
$property_name = '$t';
echo $object->{$property_name};
或者
echo $object->{'$t'};
js:
var myDog = "Hunter";
var dogs = {
Fido: "Mutt", Hunter: "Doberman", Snoopie: "Beagle"
}
var breed = dogs[myDog];
console.log(breed)// "Doberman"
php:
$property_name = '$t';
echo $object->{$property_name};
或者
echo $object->{'$t'};
js:
var myDog = "Hunter";
var dogs = {
Fido: "Mutt", Hunter: "Doberman", Snoopie: "Beagle"
}
var breed = dogs[myDog];
console.log(breed)// "Doberman"