PHP Single and Double Quotes

Single Quote Example

Hello, my name is $name.

Double Quote Example

Hello, my name is Charles.

Explanation

Single and double quotes are both used to create strings in PHP. The main difference is that double quotes can display the value of a variable inside the string. Single quotes normally display the variable name as ordinary text instead of replacing it with its value.

Back to Activity 3 Home