-->

  • PHP Case Sensitivity


    Kumar Atul Jaiswal




    PHP Case Sensitivity 


    In PHP, No keywords eg;- (if, else, while, Do while, echo etc), claasses, function, user defined function are case sensitive.


    All three echo statement below are legal ( and equal) ;-



    Example 


    <!DOCTYPE html>
    <html>
    <head>

    <title> PHP Case Sensitivity </title>

    </head>
    <body>

    <h1> </h1>


    <?php


    echo "Hello Mr. Kumar Atul Jaiswal<br>";
    ECHO "Hello Mr. Kumar Atul Jaiswal<br>";
    EcHo "Hello Mr. Kumar Atul Jaiswal<br>";



    ?>



    </body>
    </html>


    Result

    Hello Mr. Kumar Atul Jaiswal
    Hello Mr. Kumar Atul Jaiswal
    Hello Mr. Kumar Atul Jaiswal







    • However , All varibales are case-sensitive.



    In the example below, only the first statement will display the value of the
    $color variables (this is because $color, $COLOR, and $coLoR  are treated as three different variables):


    Example 



    <!DOCTYPE html>
    <html>
    <head>

    <title> PHP Case Sensitivity </title>

    </head>
    <body>

    <h1> </h1>


    <?php


    echo "My car is " . $color . "<br>";
    echo "My house is " . $COLOR ."<br>";
    echo "My boat is " . $coLoR . "<br>";



    ?>



    </body>
    </html>



    Result



    My car is red.
    My house is.
    My boat is.








    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.