Do you know what a delimiter is? How do we define strings with delimiters? ? ?

慕斯
Release: 2023-03-09 22:30:01
Original
5391 people have browsed it

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! ! !

Do you know what a delimiter is? How do we define strings with delimiters? ? ?

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;
?>
Copy after login

The demonstration results are as follows:

Do you know what a delimiter is? How do we define strings with delimiters? ? ?

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!