I’m trying to print $book->author in an echo statement. Right now I’m using concatenation.
echo "book author: " . $book->author . "<br />";
How can I include the whole thing in double quotes? If I do the following, it assumes I’m trying to echo the $book object and that ->author is a regular string.
echo "book author: $book->author<br />";
Wrap it in curly braces.
As an aside, I’m an advocate of the following. I find it reads better, overcomes limitations of the curly brace approach, and
is a micro, micro optimization over string concatenation(see comments).