variables means who can store the value and in further execution we can change the value means varying the value.
In c and C++ we normally declare variable :
In c and C++ we normally declare variable :
datatype name of variable;
int c ;
:- Here datatype means whatever the value you will assign to c that is depend on the datatype means int can accept only integer values so you can not assign value with fraction part in c
but in php the syntax is
$name of your variable ;
for example : $a ;
$a="test";
or
$a = 8.9;
In the example above, you see that you do not have to tell PHP which data type the variable is.
PHP automatically converts the variable to the correct data type, depending on its value.
In a strongly typed programming language, you have to declare (define) the type and name of the variable before using it. thats why
Comments
Post a Comment