Cannot figure out how put two values in this line of code!
if($_GET['var']=='cast')
Want use cast and distributedstudio
From a comment on the question above, your attempt was:
if($_GET['var']=='cast' && $_GET['var']=='distributedstudio')
Consider the logic you're trying to express here. The value in $_GET['var']
can never simultaneously be both 'cast'
and 'distributedstudio'
.
Did you mean to use the "or" operator?:
if($_GET['var']=='cast' || $_GET['var']=='distributedstudio')
Or perhaps query different $_GET
values?:
if($_GET['var1']=='cast' && $_GET['var2']=='distributedstudio')
Overall, to answer the question being asked, you already know how to "put two values" in your condition. The code you've written is syntactically correct and will execute as designed.
The problem is that the logic of your condition can never be true
. Whatever logic you're trying to express, break apart that logic into semantic components and write your code from there. For example, the semantics might be: "if var equals 'cast' or var equals 'distributedstudio'". Whatever your intended logic is, that's up to you.