Strings In Depth7 / 18
Up next

String interpolation

<?php
declare(strict_types=1);
$name = "Ada";
$lang = "PHP";
// bare $var interpolates inside double quotes
echo "$name writes $lang\n";
$user = ["role" => "admin"];
// braces interpolate array and object access
echo "role: {$user['role']}\n";
What you're solving

double-quoted "$var" and {$expr}