Embedding variables in text
Variables are automatically parsed in double-quoted strings.
Syntax
echo "text $variable";
Description
Inside double quotes (" "), $degisken automatically turns into its value. Inside single quotes (' '), it is written as-is.
Example
Loading editor…
Expected output
Hello Alex
When to use?
Generating dynamic text/HTML.
Common mistakes
- ⚠️ Single quotes do not evaluate $name, it literally prints 'Hello $name'.