function test(){
$embedmode = 'normal';
if ( ( $embedmode != '' ) && ( $embedmode != 'normal' || $embedmode != 'popup' || $embedmode != 'popup' ) )
return "<p>ARVE Error: mode is not set to 'normal', 'popup' or 'special' maybe typo</p>";
elseif ( $embedmode == '')
$mode = 'default';
else
$mode = $embedmode;
echo '<pre>';
var_dump($mode);
echo "</pre>";
}
echo test();
this is my attempt and I am getting a headache now it puts out the return message and I don’t know why
Your bad logic is here:
if
$embedmodeequals'normal', then$embedmode != 'popup', so this whole bit is TRUE. I believe you want to replace || with &&.For code that’s easier to reason about, I’d probably use
in_arrayorswitch, like this: