Comments and Comment Blocks in PHPコメントやコメントブロックはPHP

PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHPは、 C言語、 C + +プログラミング言語とUnixシェルスタイル( Perlのスタイル)のコメントです。 In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. PHPでは、 / /または#を使用して、 1つの行をコメントまたは/ *と* /を作る複数行にまたがる大規模なコメントをブロックします。

For example:例えば:

<?php <ですか? PHPの

echo ‘This is a test’; //This is a single-line C++ style comment echo 'これはテストです' ; / /これは、 1つのラインのC + +のスタイルのコメント
echo ‘This is another test’;#This is another single-line shell-style comment echo 'これは別のテスト' ; #これは別のシングルラインシェルスタイルのコメント
/* This is a multi line comment / *これは、複数行のコメント
Second line of comment */ 2番目の行のコメント* /

?>ですか? >

The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. " 1つのラインの"コメントスタイルのコメントを行の最後に、現在のPHPのコードブロックのか、いずれか早い方です。 This means that HTML code after the PHP script block (PHP mode broken with ?> and returns to HTML mode after end of PHP code block) will be printed.これは、 HTMLコードした後、 PHPスクリプトブロック( PHPモード壊れたとですか? >を返すHTMLモードを終了した後のPHPのコードブロック)が印刷されます。 If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>.の場合、設定ディレクティブasp_tagsが有効になって、それと同じ動作を/ / " % >と# " % >です。 However, the </script> tag doesn’t break out of PHP mode in a single-line comment.しかし、 < /スクリプト>タグはありませんから抜け出すのPHPモードで、 1つの行コメント。

For example,たとえば、

<h1>This is an <?php # echo ’simple’;?> example.<h1> <h1>これは、 <ですか? PHPのする# echo 'シンプルな' ;ですか? >例です。 <h1>
<p>The header above will say ‘This is an example’.</p> <p>のヘッダーに上記のは言う'これは一例' 。 < /人>

C or C++ style comments end at the first */ encountered. CまたはC + +形式のコメント終了の最初の* /発生しました。 Any nested /* and */ style comments will cause error, and it’s pretty easy to make this mistake if you are trying to comment out a large block of code.任意のネストされた/ *と* /スタイルのコメントが原因エラーが発生し、なかなかこの間違いを簡単に作成しようとしている場合は、大きなブロックのコードをコメントアウトしています。

<?php <ですか? PHPの

/* / *
echo ‘This is a test’; /* This comment will cause a problem */ echo 'これはテストです' ; / *このコメントは、問題の原因となる* /
*/ * /

?>ですか? >

The PHP comments is useful when you want to comment or disable a large portion of HTML.は、 PHPのコメントにコメントしたいときに便利または無効にするの大部分をhtmlに変更します。 Instead comment the HTML code line by line, put the whole HTML block into PHP code block (ie, add <?php and ?>) and comment with /* and */.コメントのHTMLコードの代わりに1行ごとに、全体のHTMLのブロックを置くPHPのコードブロック(すなわち、追加<ですか? PHPとですか? > )とコメントを/ *と* /です。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。

Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。



2 Responses to “Comments and Comment Blocks in PHP” 2つの応答を" PHPのコメントやコメントをブロック"

  1. E-Volution IT » Blog Archive » Windows Genuine Advantage circumvention電子旋回こと»ブログのアーカイブ»ホームWindows Genuine Advantage迂回
    July 26th, 2006 06:45 2006年7月26日06:45
    1

    [...] http://www.mydigitallife.info/2006/04/26/dis… http://www.mydigitallife.info/2006/04/26/dis … .です。 [...]

  2. How to Comment Code in WordPress TemplatesコメントのコードをどのようにWordPressのテンプレート
    December 10th, 2007 01:30 2007年12月10日01:30
    2

    [...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...]のヒントは、彼の帽子を私のデジタルライフをサポート-P HPのコメントやコメントをブロックします。 By Alec Tags: [...]さアレックタグ: [...]

Leave a Reply残して返信

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> これらのタグを使用することができます: <aのhref=のtitle= <abbrのtitle= <blockquote cite=""> <cite> <acronymのtitle= <b>ダウンロードの<code> <デル日時= " " >の<em> <i>て<strike> <strong> <q cite="">

Subscribe without commenting登録なしのコメント


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article検索用語を受信するには

comment out php をコメントアウトPHPの - - php comment out PHPのコメントアウト - - comentario em php PHPのcomentario日 - - comentário em php PHPのコメントの日 - - comment out in php コメントアウトはPHP - - comentario php PHPのcomentario - - comment out php code PHPコードをコメントアウト - - php coments PHPのcoments - - how to comment out php をコメントアウトする方法をPHPの - - php coment PHPのcoment - - php comment PHPのコメント - - how to comment out PHP code PHPコードをコメントアウトする方法を - - commenting out in php コメントアウトはPHP - - free coments 無料coments - - php comment block of code PHPのコメントブロックのコードを - - myspace comment blocks myspaceのコメントをブロック - - coment php coment PHPの - - php comment blocks PHPのコメントをブロック - - comentário php PHPのコメント - - comment blocks for myspace myspaceのコメントをブロック - - PHP comentario PHPのcomentario - - remark out php PHPの発言をする - - comment out a block of code in unix ブロックのコードをコメントアウトする際のUNIX - - como comentar em PHP コモコメント日PHPの - - comentario no php comentarioはPHP - - myspace comment bocks myspaceのコメントbocks - - php comment out blocks PHPのコメントアウトブロック - - php commenting PHPのコメント - - php commenting out PHPのコメントアウト - - php comment a block of code PHPのコメントをブロックのコードを - - comment out block of php をコメントアウトブロックのPHP - - php comment block PHPのコメントをブロック - - comment block in unix コメントのブロックのUNIX - - coment in php PHPのcoment - - comment blocks on myspace myspaceのコメントをブロックする - - hOW TO coment in PHP どのようにPHPのcoment - - "comentario em php" " comentario日PHPの" - - comentários em php コメント日PHPの - - comentario en php comentarioアンPHPの - - php coments code PHPのcomentsコード - - php block of comment PHPのブロックのコメント - - PHP commenting out a block of code PHPのコードブロックをコメントアウトする - - free coments on internet インターネット上の無料coments - - comment block for myspace myspaceのコメントをブロック - - comentar php PHPのコメント - - comments tag block in pHP コメントタグのブロックはPHP - - italian coments about life イタリア語coments人生について - - PHP + commenting PHPの+コメント - - norsk comments code norskコメントコード - - comment in PHP コメントはPHP - -