PHP: Variables are case sensitive

This entry is part 6 of 54 in the series PHP Tutorial

In PHP variables declared are case sensitive.

$myText = 'I love programming ';
$mytext = 'the most liberal programming language in the world PHP.';

echo "$myText  $mytext";
Try The Code

$myText is not the same as $mytext in PHP.

Note also variable string can be declared in single quote such as ‘I love programming’. We have put 2 variables in the echo statement.

If you changed echo statement into using single quotes, it will not work in this case.  Try to stick to using double quotes in echo statement.

Series Navigation<< PHP: Types of variables
PHP: Variable scope >>

Leave a comment

Leave a Reply