I have the following in my PHP to control access to a page:
<?php
$array = array(
'Joe User',
'Tom Coffee',
'Edith McBurger',
'Dan Theman'
);
if (in_array($_SESSION['user_name'], $array)) {
echo '<a href="page2link.php">Link Page</a><br>';
}
?>
It works fine but I'd rather edit a JSON or other small text file instead of editing the whole page just to alter this list.
How do I write this so the list of names is in an external file and my PHP refers to that file?