I have a small switch statement in the header of a portfolio website I'm working on which governs which links are shown on which page. The value of $id comes from the GET variable, ie - '?id=index'.
switch($id) {
case "index":
//Show links to content
case !"index":
//Show link to index
case !"about":
//show link to about page
}
The issue is that the NOT operator isn't working in the final two cases. I want the link to the index to show when the user is NOT on the index page, and likewise with the about page. Currently, ALL links are shown on the index page (when $id == "index), and NONE are shown on any other pages.
Why might this be?