title: Using JSON instead of text within a PHP array
body: <p>I have the following in my PHP to control access to a page:</p>
  
  <pre><code>&lt;?php
      $array = array(
                     'Joe User',
                     'Tom Coffee',
                     'Edith McBurger',
                     'Dan Theman'
      );
      if (in_array($_SESSION['user_name'], $array)) {
      echo '&lt;a href="page2link.php"&gt;Link Page&lt;/a&gt;&lt;br&gt;';
      }
  
  ?&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>How do I write this so the list of names is in an external file and my PHP refers to that file?</p>