구문:
<code><<<变量(无<span>$符</span>) (开头无空格)第一行 <span>XXX</span><span>XXX</span><span>XX</span>(开头无空格)变量(无<span>$符</span>)</code>
<code><span><span><?php</span><span>$s</span> =<span><<<s <p>1</p> <p>2</p> <p>3</p> s;<span>echo</span><span>$s</span>; <span>?></span><pre class="brush:php;toolbar:false"><code>1 2 3</code>
예 2:
<code><span><?php</span><span>$_data</span> =<span><<<data <?xml version="1.0" encoding="UTF-8"?> <note> <to>George</to> <from>老三</from> <heading>Reminder</heading> <body>Don't forget the meeting!</body> </note> data;</span><span>$myfile</span> = fopen(<span>"file.txt"</span>, <span>"w"</span>) <span>or</span><span>die</span>(<span>"Unable to open file!"</span>); fwrite(<span>$myfile</span>, <span>$_data</span>); fclose(<span>$myfile</span>); <span>?></span></code>
<code>file.txt内容: <span><?xml version="1.0" encoding="UTF-8"?></span><span><<span>note</span>></span><span><<span>to</span>></span>George<span></<span>to</span>></span><span><<span>from</span>></span>老三<span></<span>from</span>></span><span><<span>heading</span>></span>Reminder<span></<span>heading</span>></span><span><<span>body</span>></span>Don't forget the meeting!<span></<span>body</span>></span><span></<span>note</span>></span></code>
위 내용은 내용의 측면을 포함하여 PHP 구분 기호 여러 줄 문자열의 생성을 소개합니다. PHP 튜토리얼에 관심이 있는 친구들에게 도움이 되기를 바랍니다.