i wrote a code with few if&else sepperate statements 1)if...echo blablalba else.. blablaba 1)if...echo blablalba else.. blablaba i want that the moment the first " if " statement will be executed only the first echo statement will be printed who can i do it ? what funtion or script do i have to use? thanks in advance
sorry what do you mean by "i want that the moment the first " if " statement will be executed only the first echo statement will be printed"
if u mean "if 1st cond is valid then dont go try to 2nd if" use if...echo blablalba else {.. blablaba if...echo blablalba else.. blablaba } this would mean the blabla from first if's else is executed then 2nd if is tested
You can do it .. example : <? if ( ) echo "Any thing"; Elseif () echo "sss"; else { Echo "Flase statments": } ?> PHP:
<? if ( ) echo "Any thing"; Elseif () echo "sss"; else { Echo "Flase statments": } ?> should do the trick
Tricky if & else statements. But like q111z is mention it should work. Update us on this if you solved your problem please.
That's the whole point of an if statement, if the condition is valid it executes the statement and stops there, it won't bother looking at the else if or else.