PHP Variables Are Case-Sensitive

                    In PHP userdefined variables are case sensitive but user-defined functions,classes,PHP functions, conditional statements such as (IF,ELSE,while )and also "echo"  are not at all case sensitive and are legal to use without any syntax errors.


Example:

           <?php
                       echo "hai";echo "<br>";
                      ECHo  "Hello world";echo "<br>";
                      ECHO "I am legal to use ";
            ?>

Output:
       
        hai
        Hello world
        I am legal to use


But coming to the variables,Variables are highly case sensitive in PHP Programming Language


Case-sensitive in php

Example:

     <?php

       $string="hi";
        
       echo $string."PHP";echo "<br>";
       echo $String."PHP";

     ?>
Output:

    hi PHP
    PHP

In the above output clearly states that variables are case-sensitive.Such that in PHP $string and $String are two different variables and difference in values.

Next Chapter: Variables in PHP

Comments

Popular Posts

PHP 5 Syntax

Basic Introduction to PHP