This chapter demnstrates the use of the variable, variable definition,
different operator types, constants definition,use.
Following are the topics to be covered.
- What is the variable.How to use it.
- Different data types .
- Different types of operators and its use.
- How to use operators to create expressions.
- How to define and use constants.
Variable is the entity whose
vary.Variable word has come from mathematics.
Variable can be of any data type i.e integer,character , boolean,
Different data types are
- Float and double are decimal numeric data types.
- Integer has no decimal value.It has only integer
- Character has single character.
- String is collection of character.
has true and false
Like perl php has no specific data types variables.
But all variables are scalar variable.
Scalar variable accept all data types values
behave like that.
It has prefix $ then variable name.
- echo and print function is used
to display the variable values.
- Whenever echo and print gets the $ sign
then it prints the contents.
- echo and print also doees the various
operations using the various operators.
echo "my first program in php";