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 פגז בסגנון (פרל סגנון) תגובות. In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. ב-PHP, / / או # משמש כדי להפוך את שורת הערה אחת או / ו * * / לבצע גדול התגובה לחסום כי spans כמה שורות.

For example: לדוגמה:

<?php <? PHP

echo 'This is a test'; //This is a single-line C++ style comment הד 'זוהי בדיקה'; / / זהו אחד שורת C + + סגנון התגובה
echo 'This is another test';#This is another single-line shell-style comment הד 'זהו מבחן נוסף'; # זה עוד אחד מעטפת שורת בסגנון התגובה
/* This is a multi line comment / * זהו רב קו התגובה
Second line of comment */ בשורה השנייה של התגובה * /

?> ?>

The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. את "קו אחד" סגנונות התגובה תגובה סוף השורה או לחסום הנוכחי של קוד 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 Block) יהיה מודפס. 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. עם זאת, </ script> תג לא להתפרץ PHP במצב של אחד על שורת התגובה.

For example, לדוגמה,

<h1>This is an <?php # echo 'simple';?> example.<h1> <h1> זהו <? PHP # הד 'פשוט';?> לדוגמה. <h1>
<p>The header above will say 'This is an example'.</p> <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 */ הד 'זהו מבחן "; / * תגובה זו תגרום בעיה * /
*/ * /

?> ?>

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 תגובה על ידי שורה שורה, לשים את כל ה-HTML לתוך PHP קוד לחסום לחסום (כלומר, להוסיף <? PHP ו?>) וכן עם התגובה / * ו * /.

IMPORTANT : The page is machine translated and provided "as is" without warranty. חשוב: הדף הוא מכונה בתרגום ובתנאי "כמות שהוא", ללא אחריות. Machine translation may be difficult to understand. תרגום מכונה יכול להיות קשה להבין. Please refer to אנא פנה ל original English article המאמר המקורי באנגלית whenever possible. ככל שניתן.


3 Responses to “Comments and Comment Blocks in PHP” 3 תגובות ל "ו תגובה תגובות חוסמת ב PHP"

  1. Walter De Vos » Hoe High Quality YouTube Videos embedden וולטר דה vos »טוריה High Quality YouTube Videos embedden
    January 16th, 2009 01:11 ינואר 16, 2009 01:11
    3 3

    [...] Er is een hack waarmee toch Hoge kwaliteit video kan geïntegreerd worden. [...] Er היא een גרזן waarmee toch Hoge kwaliteit וידאו kan geïntegreerd worden. Zie How to Embed High Quality and Higher Resolution YouTube Videos on Blog or Website » My Digital Life [...] Zie כיצד שבץ באיכות גבוהה ברזולוציה גבוהה יותר וידאו ב-YouTube בלוג או אתר אינטרנט »Digital החיים שלי [...]

  2. How to Comment Code in WordPress Templates כיצד להגיב קוד תבניות WordPress
    December 10th, 2007 01:30 10 דצמבר 2007 01:30
    2 2

    [...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] עצה של הכובע שלי על החיים הדיגיטלי שלו מאמר - דרכים תגובה תגובות ו ב PHP. By Alec Tags: [...] מאת Alec תגיות: [...]

  3. E-Volution IT » Blog Archive » Windows Genuine Advantage circumvention ה-IT Volution »ארכיון הבלוג» Windows Genuine Advantage עקיפה
    July 26th, 2006 06:45 יולי 26, 2006 06:45
    1 1

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

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=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <דל datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. הצטרף כמנוי ל הערות תכונה הושבת. To receive notification of latest comments posted, subscribe to כדי לקבל הודעה על תגובות העדכנית פורסם, כדי להירשם My Digital Life Comments RSS feed החיים שלי דיגיטלי תגובות RSS Feed or או register to receive הרשמה לקבלת new comments in daily email digest. תגובות חדש ב דוא"ל תקציר יומי.
Custom Search

New Articles מאמרים חדשים

Incoming Search Terms for the Article חיפוש נכנס על תנאי סעיף

comment out php התגובה החוצה PHP - -- coment php coment PHP - -- php coment PHP coment - -- how to comment out php כיצד להגיב החוצה PHP - -- php comment out PHP את התגובה - -- php comment blocks PHP תגובה בלוקים - -- php coments PHP coments - -- coments in php coments ב PHP - -- comentar em php comentar em PHP - -- php comment block PHP התגובה לחסום - -- coments php coments PHP - -- comentário php comentário PHP - -- comment out in php התגובה החוצה PHP - -- php comment out block PHP לחסום את התגובה - -- coment in php coment ב-PHP - -- coment on php coment ב PHP - -- comentario em php comentario em PHP - -- como comentar em php קומו comentar em PHP - -- all הכל - -- comentário em php comentário em PHP - -- html comment block HTML התגובה לחסום - -- comment block in php התגובה לחסום ב PHP - -- myspace comment blocks MySpace comment בלוקים - -- php comentario PHP comentario - -- comment out php script התגובה החוצה סקריפט PHP - -- php block comments PHP לחסום תגובות - -- comentários php comentários PHP - -- comment blocks in php התגובה בלוקים ב PHP - -- PHP comment block code התגובה לחסום קוד PHP - -- how to coment in php כיצד coment ב-PHP - -- comment block php התגובה לחסום PHP - -- comentario en php comentario en PHP - -- comment blocks of php התגובה של חוסם PHP - -- how to comment out php code כיצד להגיב PHP את הקוד - -- comment blocks PHP הערה חוסם PHP - -- comment block of php code לחסום את התגובה של קוד PHP - -- block comment php לחסום את התגובה PHP - -- comentários em php comentários em PHP - -- coment out php coment החוצה PHP - -- comment php blocks התגובה PHP בלוקים - -- myspace comments blocks MySpace חוסמת תגובות - -- php comment out blocks of code PHP חוסם את התגובה של הקוד - -- php + comment out a block of code PHP + א לחסום את התגובה של הקוד - -- comment block of code php לחסום את התגובה של קוד PHP - -- comentarios em php comentarios em PHP - -- "comment out in php" "התגובה החוצה PHP" - -- comentario php comentario PHP - -- block comment out php לחסום את התגובה PHP - -- comment block in html לחסום את התגובה ב-HTML - -- comentar no php comentar לא PHP - --