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 私のデジタルライフフォーラム .です。
Related Articles関連記事
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3つのコラムのテーマのコメント- paged.phpを緩和WordPressのページ-コメントWordPressの差込式
- Fight and Stop Comment Spam and Trackback Spam with Akismetトラックバックコメントスパムと戦うと停止マークをAkismetの差
- Integrate WordPress including Comments with bbPress Forum using bbSync bbpress WordPressのフォーラムを含む統合を使用してコメントをbbsync
- PHP Parse Error: syntax error, unexpected $end PHPのパースエラー:構文エラーが発生すると、予期しない$エンド
- How to Add and Put Picture or Image in MySpace Commentどのように写真や画像を追加して、 myspaceのコメント
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Monthサーバーの負荷を減らすAkismetの差を自動的に破棄マークを使用してコメントを投稿年齢が1カ月
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam無料でダウンロードできます: Akismetの差込式の2.0を停止するのWordPressのコメント、トラックバックとPingbackのマーク
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet停止コメント、トラックバックPingbackのとマークを新しいバージョンのAkismetの差
- WordPress 2.2 Released for Free Download WordPressの2.2リリースを無料でダウンロードできます
- Rapid Leech Download from RapidShare, MegaUpload, Uploading, MyTempDir and Other File Sharing Services to Server急速なリーチからダウンロードできます。 rapidshare 、 megaupload 、アップロード、およびその他のファイル共有サービスをmytempdirサーバー



















July 26th, 2006 06:45 2006年7月26日06:45
[...] http://www.mydigitallife.info/2006/04/26/dis… http://www.mydigitallife.info/2006/04/26/dis … .です。 [...]
December 10th, 2007 01:30 2007年12月10日01:30
[...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...]のヒントは、彼の帽子を私のデジタルライフをサポート-P HPのコメントやコメントをブロックします。 By Alec Tags: [...]さアレックタグ: [...]