PHP 8 · Strings and arrays
Insert variables in strings
Use double quotes or curly braces for expressions.
echo "Hello, {$user->name}! You have {$count} messages.";
PHP 8 · Strings and arrays
Use double quotes or curly braces for expressions.
echo "Hello, {$user->name}! You have {$count} messages.";
Was this page helpful?