This article mainly introduces the definition methods of PHP strings and their differences. It has certain reference value. Now I share it with you. Friends in need can refer to it
Single quotes:
. to connect variables and variables, variables and strings, and strings and strings
.
#
$str = <<<EODExample of string spanning multiple lines using heredoc syntax. EOD; $str = <<<"FOOBAR"Hello World!FOOBAR;
There cannot be any other symbols before the end identifier (indentation is not allowed)
$str = <<<'EOD'Example of string spanning multiple lines using nowdoc syntax. EOD;
##Both are used to process large text
The above is the detailed content of PHP string definition methods and their differences. For more information, please follow other related articles on the PHP Chinese website!