PHP Single and Double Quotes

Single Quote Example

Hello $name

Double Quote Example

Hello Alex

Explanation

Single quotes usually display text exactly as it is written, so a variable name inside single quotes is not replaced with its value. Double quotes can recognize variables and place their values inside the text. Double quotes also work with more escape sequences, while single quotes are useful when I want simple text.

Back to Activity 3