Hello
I want PHP to check if the variable section is not home or services, and if it isn't, to set it to about.
if (!$section== home, services){$section = about;}
But it doesn't work.
Thanks
if($section != 'home' and $section != 'services') { $section = 'about'; }
It works!
Can I do ($section != 'home', 'services', 'blah') or something to save space?
No, 'services' is not a whole statement that returns true or false.
if(!in_array($section, array('home', 'services', 'foo', 'bar', 'yadda', 'etc'))) { $section = 'about'; }