Is PHP Case-Sensitive? | PHP Variables and Functions Explained

Is PHP Case-Sensitive? | PHP Variables and Functions Explained

Category: Php

Yes, PHP is case-sensitive for variables, meaning $Name and $name are treated as different variables. However, function names, class names, and keywords (such as if, echo, etc.) are not case-sensitive.

🧠 Example:

$Name = "John"; echo $name; // Undefined variable: $name

In this example, $Name is defined, but $name is not—so PHP will throw an "undefined variable" notice.

  • Difference between isset() and empty() in PHP?
  • What are Magic Methods in PHP?
  • What is the difference between unset() and unlink() in PHP?
  • What is the difference between MySQLi and PDO?
  • What is the difference between == and ===in