How do I properly state this comparison?
-
I need to add to an existing block of code to specify which CSS a page uses.
I want to basically say:
If using THIS PAGE, then use THIS CODE for your css
else, if using THAT PAGE, then use THAT CODE for your css
else, if using NEITHER PAGE, then use SOME OTHER CODE for your css.So my code looks something like this (Note, $site_view is defined earlier in the header):
if($site_view==’first’) {$site=array( big long array );}
elseif($site_view==’second’) {$site=array( big long array );}
elseif($site_view==’third’) {$site=array( big long array );}Now I want to essentially add this but I’m not sure if the statement syntax is correct. Should i use the commas or something else to separate them?:
elseif($site_view != ‘first’, ‘second’, ‘third’) {$site=array( big long array );}
I know it’s messy, but due to how the site is built, this is the easier alternative over developing a ‘fourth’ for $site_view since this all defines what the url is.
Thanks!
- The topic ‘How do I properly state this comparison?’ is closed to new replies.