lundi 5 février 2018

php long list of if ($thispage or $thispage)

I have a nav that I need to display different items based on the page it is rendered, so I am using the following

if ($thisPage=="page one" or $thisPage=="page two" or $thisPage=="page three")

and it works fine, problem is I might need more than just three pages, and I could need to add more time to time, making it a long list, is there a way to have an array holding all the pages that I can call in the if statement, which would make it simpler to maintain (i.e. adding the new page I could need)?

Aucun commentaire:

Enregistrer un commentaire