Home > Article > Backend Development > Do you know what a delimiter is? How do we define strings with delimiters? ? ?
The previous article introduced you to "PHP Learning: Deep Understanding of Strings". This article continues to introduce to you the application of using delimiters to define strings: Let's study together! ! !
What is a delimiter:
The delimiter is another way to define a string. Delimited methods use delimiter syntax ("
Start with the identifier
EOT and end with the identifier
EOT. (We not only use EOT alone, but can also replace EOT with EOF)
Regarding the delimiter, we use code to show it specifically:
<?php $string = <<<EOT 怨歌留待醉时听,远目不堪空际送. 今宵风月知谁共,声咽琵琶槽上凤. 人生无物比多情,江水不深山不重. EOT; echo $string; ?>
The demonstration results are as follows:
The use of delimited identifiers must also follow the naming rules of any other label in PHP: can only contain letters, numbers, underscores or non-digit characters at the beginning.
Recommended Learning: "<a href="https://www.php.cn/course/list/29/type/2.html" target="_self">PHP Video Tutorial</a>"
The above is the detailed content of Do you know what a delimiter is? How do we define strings with delimiters? ? ?. For more information, please follow other related articles on the PHP Chinese website!