Currently I'm using this code: <?php/*Clean, Simple, Minimal.*/$pages = array('home', 'login', 'register', 'logout', 'test');if (isset($_GET['p'])){    $page = $_GET['p'];    if (in_array($page, $pages))    {       include('pages/' . $page . '.php');    }}  else {    echo 'Hi';}?>I want this to be as secure and efficient as possible, I've seen multiple versions of this. I wasn't sure how to do what i really wanted, I wanted it so that if the requested file .php exists in /pages/ it'll show it, and else throw an error. But last time i did that I was vulnerable to LFI. 
Including file based on user input: Efficiency and Security
php;security