[prev] [index] [next]

Strings

When variables are used inside a "..." string or heredoc
  • their value is interpolated into the string
  • after being converted to a suitable string representation
Example:

$a = 1;  $b = 3.5;  $c = "Hello";
$str = "a:$a,  b:$b,  c:$c";
// now $str == "a:1, b:3.5, c:Hello"

Note that interpolation does occur in   "This is '$it'"

I.e. <? $it = 5; print "This is '$it'"; ?>  displays  This is '5'