-->

  • php comments





    Comments in PHP code 

    A comment in php code is a line that is not read/ excuted as part of the program. it's only purpose is to be read someone who is  looking at the code.



    Comments can be used to :


    • Lets other understand what are you doing
    • Remind yourself of what you did - Most Programmers have experienced coming back to their own work a year or two later and having to re-figure out what they did.comments can remind you of what you were thinking when you wrote the code



    PHP support several ways of commenting :






    Example 


    <!DOCTYPE html>
    <html>
    <head>

    <title> PHP comments </title>

    </head>
    <body>

    <h1> </h1>


    <?php

    // This is a single line comment

    # This is also a single line comment

    /* 

    This is a multiple-lines comment blocks that spans over multiple lines.

    */

    //  You can also use comments to leave out parts of a code


    $x =  10     /*  -25 + 25   */     *5;   

    echo  $x;?>



    </body>
    </html>




    Result

      50

    -----------------------------------------------------------------------------


    Read also these topics  :







    • PHP 7 : Why should you learn PHP  :-  Click Here
















  • PHP 7 Syntax  :-  Click Here 




    • --------------------------------------------------------------------------


      Video on This Topic :-  SooN















      Have a Nice Stay Here    :  -  )



      0 comments:

      Post a Comment

      For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.