Quotation Marks

Julianne Salazar

For the most part it doesn't matter which kind of quotation marks you use. For example:


This sentence uses a single quotation.
This sentence uses a double quotation.

See the outcome is the same. But it is important to note that a single quotation marks (' ') in PHP define text exactly as they are, with no variable substitution. Variable substitution can be done using double quotation marks (" "), allowing you to include variable values within the text. The example below uses variables to show the difference when using single or double quotation marks.

The amount of aliens Ben has is $alien.
The amount of aliens Ben has is 10.