Example of Variables in php in daily life
no of students in every class is a variable as it is different for every class.variable in PHP
variables in PHP is declared by "$" sign.
PHP automatically converts the variable to the correct data type, depending on its value. After declaring a variable it can be reused throughout the code. The assignment operator ( = ) used to assign value to a ...
Example
$a, $b etc
you can name the variable whatever you want but it is a common practice to name the variable similar to what is its purpose so it will we easy to understand why it is made if another person sees your code.
variables can be used to store data of any type in PHP, in PHP there is no need to define the type of a variable any variable can store any kind of data.
$variable1=0; In this case it is storing a numeric value
$variable1="brainlight"; In this case it is storing a string.
so a variable can store any kind of data.
0 Comments
Your Comment is Submitted