PHP Example | Understand String Interpolation

In this article, we will use a php example to help you understand string interpolation in php.

We will show you three kinds of string interpolation in php. They are:

$first_name = "Note";
$last_name = "Hope";
$full_name_concat = $first_name . " " . $last_name;
//output: Note Hope
$full_name_interpolate = "{$first_name} {$last_name}";
//output: Note Hope
$full_name_interpolate_v2 = "$first_name $last_name";
//output: Note Hope