PHP Variables

From Tutorial
Jump to: navigation, search

Variables are the names used to store data in programming language. The values stored in a variable may be changed during the execution of the program. The php variable names are starting with a dollar ( $ ) symbol. The variable declaration is not required in php. The php variables donot have a type declaration. The data type of the php variable are automatically determined according to the usage.

Example for legal variable names

  • $variable
  • $Count
  • $_QESTION
  • $Y13
  • $one_hrs
  • $$a

Examples of invalid variable names

  • $1024
  • $*abc
  • $xy-z
  • $1hrs

Variable names in php are case-sensitive. That is $name is diiferent from both $NAME and $Name.

Personal tools