Comments and Comment Blocks in PHP Kommentare Kommentar-Blöcke in PHP
PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP unterstützt die Sprache C, C + + Programmiersprache und Unix-Shell-Stil (Perl-Stil) kommentiert. In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. In PHP, / / oder # verwendet wird, um eine Single-Line oder Kommentar / * und * /, um einen großen Block Kommentar, dass mehrere Zeilen umfasst.
For example: Zum Beispiel:
<?php <? php
echo ‘This is a test’; //This is a single-line C++ style comment echo "Dies ist ein Test"; / / Dies ist ein Single-Line C + +-Stil Kommentar
echo ‘This is another test’;#This is another single-line shell-style comment echo "Dies ist ein weiterer Test '; # Dies ist eine weitere Single-Line-Shell-Stil Kommentar
/* This is a multi line comment / * Dies ist ein Multi-Kommentar
Second line of comment */ Die zweite Zeile des comment * /
?>
The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. Das "one-line" Kommentar Stile Kommentar zum Ende der Zeile oder den aktuellen Block von PHP-Code, welcher Fall zuerst eintritt. 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. Dies bedeutet, dass HTML Code nach der PHP-Skript Block (PHP Modus defekt?> Und wieder in den HTML-Modus nach dem Ende der PHP-Code-Block) wird gedruckt. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Wenn die Direktive asp_tags aktiviert ist, es verhält sich mit der gleichen / /%> und #%>. However, the </script> tag doesn’t break out of PHP mode in a single-line comment. Allerdings ist die </ script>-Tag nicht ausbrechen von PHP-Modus in einem einzigen Online-Kommentar.
For example, Zum Beispiel,
<h1>This is an <?php # echo ’simple’;?> example.<h1> <h1> Dies ist ein <? php # echo "einfaches";?> Beispiel. <h1>
<p>The header above will say ‘This is an example’.</p> <p> The header oben wird sagen: "Dies ist ein Beispiel". </ p>
C or C++ style comments end at the first */ encountered. C oder C + +-Stil Kommentare Ende bei der ersten * / begegnet. 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. Jede verschachtelte / * und * / style Kommentare werden dazu führen, dass Fehler, und es ist ziemlich leicht zu machen Fehler, wenn Sie versuchen, kommentieren Sie ein großer Block von Code.
<?php <? php
/* / *
echo ‘This is a test’; /* This comment will cause a problem */ echo "Dies ist ein Test"; / * Dieser Kommentar wird ein Problem verursachen * /
*/ * /
?>
The PHP comments is useful when you want to comment or disable a large portion of HTML. Die PHP-Kommentaren ist nützlich, wenn Sie wollen, zu kommentieren oder zu deaktivieren ein großer Teil von 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 */. Stattdessen kommentieren Sie den HTML-Code Zeile für Zeile, die den kompletten HTML-Block in PHP-Code-Block (dh, fügen Sie <? Php und?>) Und Kommentar mit / * und * /.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. WICHTIG: Es handelt sich um eine Maschine der Seite übersetzt wird "as is" ohne Garantie. Machine translation may be difficult to understand. Maschinelle Übersetzung ist vielleicht schwierig zu verstehen. Please refer to Bitte wenden Sie sich an original English article Original Englisch Artikel whenever possible. wann immer dies möglich ist.
Share and contribute or get technical support and help at Aktie und einen Beitrag oder erhalten technische Unterstützung und Hilfe an My Digital Life Forums Meine digitalen Lebens Foren .
Related Articles Verwandte Artikel
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3 Spalte Entspannung WordPress Theme-Kommentare paged.php für Paged-Kommentare WordPress steckbar
- Fight and Stop Comment Spam and Trackback Spam with Akismet Kampf und Anschlag Kommentar-Spam und Trackback Spam mit Akismet
- Integrate WordPress including Comments with bbPress Forum using bbSync Integrieren WordPress einschließlich Kommentare mit bbPress Forum mit bbSync
- PHP Parse Error: syntax error, unexpected $end PHP Parse error: syntax error, unexpected $ end
- How to Add and Put Picture or Image in MySpace Comment Hinzufügen und Bild oder Bild in MySpace Kommentar
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Reduzieren Server Load Verwendung Akismet automatisch zu entledigen Spam-Kommentare über die Beiträge älter als einen Monat
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Kostenloser Download: Akismet Plugin für WordPress 2,0 auf Stop Kommentar, Trackback und Pingback Spam
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Stop-Kommentar, Pingback und Trackback Spam mit Neue Version von Akismet
- WordPress 2.2 Released for Free Download WordPress 2,2 zum freien Download
- Rapid Leech Download from RapidShare, MegaUpload, Uploading, MyTempDir and Other File Sharing Services to Server Rapid Leech Download von RapidShare, megaupload, Hochladen, MyTempDir und andere Filesharing-Dienste auf Server

































July 26th, 2006 06:45 26. Jul 2006 06:45
[...] http://www.mydigitallife.info/2006/04/26/dis… . [...]
December 10th, 2007 01:30 10. Dez 2007 01:30
[...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] Spitze des Zu meinen Hut Digital Life für seine Artikel - Kommentare Kommentar Blöcke in PHP. By Alec Tags: [...] Mit Alec Tags: [...]