How can you use an object’s property in a double-quoted string?
When you enclose a variable name in a double-quoted string it will be replaced by that variable’s value: $foo = 2 “$foo” becomes “2” If you don’t want that you have to use single quotes: $foo = 2 ‘$foo’ However, if you want to access properties, or use indexes on variables in a double-quoted string, … Read more