Comments and Comment Blocks in PHP Komentar Komentar dan Blok di PHP
PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP mendukung bahasa C, C + + bahasa pemrograman dan Unix shell-style (Perl gaya) komentar. In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. Di PHP, / / atau # digunakan untuk membuat komentar baris tunggal atau / * dan * / untuk membuat blok komentar yang besar spans beberapa baris.
For example: Sebagai contoh:
<?php <? php
echo 'This is a test'; //This is a single-line C++ style comment echo "Ini merupakan ujian '; / / ini adalah satu-baris C + + gaya komentar
echo 'This is another test';#This is another single-line shell-style comment echo 'Ini adalah satu lagi ujian'; # Ini adalah satu-line shell-gaya komentar
/* This is a multi line comment / * Ini adalah beberapa baris komentar
Second line of comment */ Kedua baris komentar * /
?> ?>
The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. Yang "satu baris" komentar gaya komentar ke akhir baris saat ini atau blok kode PHP, yang mana lebih dulu. 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. Ini berarti bahwa kode HTML setelah script PHP (PHP dengan modus rusak?> Dan kembali ke mode HTML setelah akhir blok kode PHP) akan dicetak. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Jika asp_tags konfigurasi direktif diaktifkan, it behaves yang sama dengan / /%> dan #%>. However, the </script> tag doesn't break out of PHP mode in a single-line comment. Namun, </ script> tag tidak lolos PHP dalam modus satu-baris komentar.
For example, Misalnya,
<h1>This is an <?php # echo 'simple';?> example.<h1> Ini merupakan <h1> <? php # echo 'sederhana';?> contoh. <h1>
<p>The header above will say 'This is an example'.</p> Seluruh judul yang di atas akan berkata "Ini adalah contoh '. </ p>
C or C++ style comments end at the first */ encountered. C atau C + + gaya komentar di akhir pertama * / dihadapi. 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. Apapun nested / * dan * / gaya komentar akan menyebabkan kesalahan, dan it's pretty mudah untuk membuat kesalahan jika Anda mencoba untuk keluar komentar besar blok kode.
<?php <? php
/* / *
echo 'This is a test'; /* This comment will cause a problem */ echo "Ini merupakan ujian '; / * komentar ini akan menyebabkan masalah * /
*/ * /
?> ?>
The PHP comments is useful when you want to comment or disable a large portion of HTML. PHP komentar yang berguna jika anda ingin komentar atau menonaktifkan besar dari 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 */. Sebaliknya komentar kode HTML baris oleh baris, menempatkan seluruh HTML blok kode PHP ke dalam blok (yakni, tambahkan <? Php dan?>) Dan komentar dengan / * dan * /.
IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman yang diterjemahkan mesin dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Mesin terjemahan mungkin sulit dimengerti. Please refer to Silakan merujuk ke original English article artikel asli Inggris whenever possible. bila memungkinkan.
Related Articles Artikel Terkait
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3 Column Wordpress Theme Relaxation komentar-paged.php untuk Paged-Komentar Wordpress Plugin
- How to Add and Put Picture or Image in MySpace Comment Bagaimana Tambahkan Debitkan dan Gambar atau Foto di MySpace Komentar
- How to List and Show WordPress Posts That Comments and Pings Off (Not Allow) Cara Daftar dan Wordpress Perlihatkan Posting Komentar Itu dan Ping Nonaktif (Tidak P'boleh)
- Fight and Stop Comment Spam and Trackback Spam with Akismet Berjuang dan Berhenti Spam dan Trackback Komentar Spam dengan Akismet
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Free Download: Akismet Plugin untuk Wordpress 2,0 untuk Stop Komentar, Trackback dan Pingback Spam
- Google AdSense Policy Update Disallows Image Besides Ads Blocks Kebijakan Google AdSense Update Dilarang Image Selain Blok Kemarin
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Komentar berhenti, dan Trackback Pingback Spam dengan Akismet Versi Baru
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Mengurangi Load Server Menggunakan secara otomatis ke Akismet Spam Buang Komentar tentang Posts lama daripada J Bulan
- Moderate WordPress Blog Comments Via Moderator with Desktop Client Moderat Wordpress Blog Komentar Via moderator Desktop dengan Klien
- Integrate WordPress including Comments with bbPress Forum using bbSync Mengintegrasikan termasuk Komentar Wordpress dengan menggunakan bbPress Forum bbSync










































January 16th, 2009 01:11 Januari 16, 2009 01:11
[...] Er is een hack waarmee toch Hoge kwaliteit video kan geïntegreerd worden. [...] Er is een hack waarmee toch Hoge kwaliteit video kan geïntegreerd worden. Zie How to Embed High Quality and Higher Resolution YouTube Videos on Blog or Website » My Digital Life [...] Zie Bagaimana Embed Kualitas tinggi dan Resolusi Tinggi YouTube Video Website atau di Blog »My Life Digital [...]
December 10th, 2007 01:30 10 Des 2007 01:30
[...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] Tip of the hat ke My Digital Life untuk artikelnya - Komentar dan Komentar Blok di PHP. By Alec Tags: [...] Oleh Alec Tag: [...]
July 26th, 2006 06:45 26 Jul 2006 06:45
[...] [...] http://www.mydigitallife.info/2006/04/26/dis… http://www.mydigitallife.info/2006/04/26/dis ... . . [...] [...]