ファイルのheredoc
ブロック内にコメントを追加できないようです。foo.php
echo <<<_HEREDOC_FOO
// okay this comment was intended to explain the code below but it
// is showing up on the web page HTML sent to the browser
<form action="foo.php" method="post">
<input type="submit" value="DELETE RECORD" /></form>
_HEREDOC_FOO;
確かにフォームは機能しますか (ところで、上記のフォーム コードは、私の質問のために大幅に切り捨てられています) 。
しかし、ダンコメント ( okay this comment was..blah blah blah
) もブラウザーに表示されます。上記のようにブラウザに表示されます。
// okay this comment was intended to explain the code below but it
// is showing up on the web page HTML sent to the browser
私が試したコメント境界の順列:
// <--
// -->
と....
<-- //
--> //
どちらの場合も FAIL で、内部でコメントできるようにしますheredoc
。
では、どうすれば s 内のコードをコメントアップできheredoc
ますか?