A variable is a keyword or phrase that acts as an identifier for a value stored in a system’s memory. This is useful because it allows us to write programs that will perform a set of actions on a variable value, which means you can change the output of the program simply by changing the variable, rather than changing the program itself.
Storing Values in a Variable
PHP lets you store nearly anything in a variable using one of the following data types:
String : Alphanumeric characters, such as sentences or names
Integer: A numeric value, expressed in whole numbers
Float: A numeric value, expressed in real numbers (decimals)
Boolean: Evaluates to TRUE or FALSE (sometimes evaluates to 1 for TRUE and 0 for FALSE)
Array: An indexed collection of data
Object: A collection of data and methods
No comments:
Post a Comment