Hello, New to php, I wan't to compare two variable in a switch statement:
switch ($src1) { case $comp1: inst_1; break; case $comp2: inst_2; break; default: inst_default; }
my problem is that this code allways execute inst_default.
Regards.
make sure all of the variables are set and that the variable $src1 is equal to one of the other variables.
echo out the value of the variables so that you can see whats going on.
Of course I did so.. i echoed all strings before but allways went to default. Does it come from variable and constants or expression comparison ? I temporally used an if sentence but not so good to read.
regards