You can define a constant using the define() directive.you can use this a number of ways;to define a variable to a constant do:$string = "hello";define("string",$string);to define a string to a constant use:define("hello","there");to define a integer or other numerical value use:define("number",1.0);Summery:to define a string use quotes as you would do a string.Unlike variables in PHP a constant cannot be changed or undefined once it is defined. Constant remains automatically globally throughout the script. It means that it can be accessed from inside a function. e.g.
I define an variable by saying x- an value
The constant is the number; the variable is the letter.
the controlled variables are the factors that are kept constant during an experiment. if they are not kept constant then they may affect the outcome of the experiment. the manipulated variable is the factor that is different between the experiment and the control. the responding variable is the variable that is being measured in the experiment.
The question is about an oxymoronic expression. A constant cannot be a variable and a variable cannot be a constant!
Just type declare then the variable that you desire to assigned a certain constant value on it. Just type declare then the variable that you desire to assigned a certain constant value on it.
You can define a constant using the define() directive.you can use this a number of ways;to define a variable to a constant do:$string = "hello";define("string",$string);to define a string to a constant use:define("hello","there");to define a integer or other numerical value use:define("number",1.0);Summery:to define a string use quotes as you would do a string.Unlike variables in PHP a constant cannot be changed or undefined once it is defined. Constant remains automatically globally throughout the script. It means that it can be accessed from inside a function. e.g.
I define an variable by saying x- an value
static variables are declared to define a variable as a constant., means if you declare a variable as static the variable becomes costant.syntaxstatic int a=100;this will make the value of a as 100 which is not to be changedWell, no; you think of 'const', which can be used together with static, but not necessarily.Yes you are right bro I was confused it should be const int a=100; then the variable will be a constant.
The constant is the number; the variable is the letter.
the controlled variables are the factors that are kept constant during an experiment. if they are not kept constant then they may affect the outcome of the experiment. the manipulated variable is the factor that is different between the experiment and the control. the responding variable is the variable that is being measured in the experiment.
The question is about an oxymoronic expression. A constant cannot be a variable and a variable cannot be a constant!
Constant variable
They define a variable by saying n equals some value.
A constant is not a variable at all, and none of its factors was a variable. It is constant.
The opposite of the word "constant" is "variable".
A constant is a variable that does not change. The correct term is constant variable.