A string is a series of letters, in which a letter resembles a byte. This means that PHP only supports a 256-character set


A string literal can be specified in four different ways:

  • single quoted
  • double quoted
  • heredoc syntax
  • nowdoc syntax

Single quoted

The simplest way to specify a string is to enclose it in single quotes (the character ').


echo 'this is a simple string';

Double quoted

If the string is enclosed in double-quotes ("), PHP will interpret the following escape sequences for special characters:


echo "this is an another simple string";


The third way to separate wires is heredoc syntax: <<<. After this operator, a signal is provided, and then a new line The cable itself follows, and then the same signal again closes the quotation.