Strings

Variables

  • Use the curly brace syntax for variable interpolation

Example

$message = "Hello, {$name}";

Concatenation

  • Use the . operator for concatenation
  • Spaces should be used around the . operator

Example

$fullName = $firstName . ' ' . $lastName;

$message = $greeting . $salutation;
Previous
Home
Next
Home