Learn Before
Concept

PHP Variables

A PHP variable's name can be short (like x and y) or descriptive (like age, car_name, or total_volume). Rules for PHP variables:

  • A variable starts with a dollar sign, followed by the name of the variable.
  • A variable name must start with a letter or the underscore character (_).
  • A variable name cannot start with a number.
  • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _).
  • Variable names are case-sensitive ($age and $AGE are two distinct variables).

0

1

Updated 2026-05-18

References


Tags

Object-Oriented Programming (OOP) Languages

Object-Oriented Programming

Programming Language Paradigms

General programming languages

Computing Sciences

Related