[prev] [index] [next]

Strings

Strings: sequences of characters, similar to Perl
  • double-quoted strings ("...") permit interpolation, e.g.

    $x = 5;  print "Value of x is $x\n";
    // prints "Value of x is 5"
    

  • single-quoted strings ('...') don't do interpolation

    $x = 5;  print 'Value of x is $x\n';
    // prints "Value of x is $x"
    

In "...", complex variables may need to be {...}
e.g. "The class member is {$obj->item}"