PHP Case Sensitivity

Basically names of user-defined functions, classes, built-in constructs and keywords such as echo, while, class, etc., are case-insensitive.

In the example below, all three echo statements below are legal (and equal):

Example

<html>
<head>
<title>PHP Comments</title>
</head>
<body>
<?php   
echo("hello, world!");
ECHO("hello, world!");
EcHo("hello, world!");
?>
</body>
</html>

However; variables on the other hand, are case-sensitive. That is, $variable, $VARIABLE, $VariaBle and $VAriable are four different variables.

Example

<html>
<head>
<title>PHP Comments</title>
</head>
<body>
<?php   
$variable = "pen";
ECHO "This is my ". $variable . "<br/>";
ECHO "This is my ". $VARIABLE . "<br/>";
$VARIABLE = "shirt";
ECHO "This is my ". $VARIABLE . "<br/>";
ECHO "This is my ". $VariaBle . "<br/>";
$VariaBle = "car";
ECHO "This is my ". $VariaBle . "<br/>";
?>
</body>
</html>

This will produce following result

This is my pen
This is my
This is my shirt
This is my
This is my car


 
SHARE THIS IF YOU LIKE!
submit to reddit

SUBSCRIBE FOR LATEST UPDATES
HAVE WE CONNECTED ON FACEBOOK?
TOP TUTORIALSTOP CODE EXAMPLESTOP LIVE DEMOLINKSSTAY CONNECTED
HTML Tutorial
HTML5 Tutorial
Bootstrap3 Tutorial
Javascript Tutorial
TypeScript Tutorial
AngularJS Tutorial
CSharp Tutorial
PHP Tutorial
Developer Tools
Javascript
AngularJS
Google MAP API V3
ASP.NET
Javascript
AngularJS
Google MAP API V3
Contact Us
Advertise with Us
Privacy Policy
Disclaimer
Stay connected. We actually like you. If you want to get up to the minute updates, then connect with us on your fav below.
 
Twitter   Linkedin   Facebook   Google+    RSS   Pinterest
 
Protected by Copyscape Original Content Checker
 
 
Copyright ©2017 www.techstrikers.com Unauthorized reproduction/replication of any part of this site is prohibited.