I am playing around with wordpress and wondering, why this line of code works:
echo "<a href='....'>$name</a>";
I learned it this way:
echo "<a href='....'>".$name."</a>";
Is there something special defined in WP to make this work?
I am playing around with wordpress and wondering, why this line of code works:
echo "<a href='....'>$name</a>";
I learned it this way:
echo "<a href='....'>".$name."</a>";
Is there something special defined in WP to make this work?
You must be logged in to post a comment.
In PHP, there are two types of
String
.The first type uses the single quotes, as follows.
The second type is as follows:
With the latter type, any variables included in the string will be resolved to their values, so:
There are lots of other differences, which you can read about here.