title: Can PHP Array Keys have an Alias?
body: <p>This is just a curious question, the reasoning behind it is purely to be slightly more lazy on my part. Here is what I mean..</p>
  
  <p>Say I have a website, where htaccess makes nice urls, and sends that data to the $_GET['p'] array key as the current 'page'. In the index file, I setup the page, and the first thing I do is setup some page settings in a config file, $_PAGE array. Now, say I have multiple pages I want to have the same settings, (and down in the page, other things may slightly change that do not correspond to the settings. So currently, I have something that looks like the following 2 php files.</p>
  
  <pre><code>// index.php
  include('page.array.php');
  
  echo '&lt;title&gt;'.$_PAGE[$_GET['p']]['title'].'&lt;/title&gt;';
  
  // page.array.php
  $_PAGE = array(
      'some/page/' =&gt; array(
          'title' =&gt; 'This is an example'
      )
  )
  $_PAGE['some/aliased/page/'] = $_PAGE['some/page/'];
  </code></pre>
  
  <p>Notice that at the end ofthe page array, in order to 'alias' a page I must add this to the end after the array has been created.</p>
  
  <p>Is there any method in php that maybe I am just unaware of, that could make me a tad bit lazier (and at the same time add to cleaner code), and make it so I can simply alias the key? I notice the following doesn't work, and I suppose my question is, is there any way to create the alias within the same array during the creation of the array?</p>
  
  <p>This example deosn't work:</p>
  
  <pre><code>// page.array.php
  $_PAGE = array(
      'some/page/' =&gt; array(
          'title' =&gt; 'This is an example'
      ),
      'some/aliased/page/' =&gt; $_PAGE['some/page/']
  )
  </code></pre>
  
  <p>Maybe a way to refer to "this" array, from within itself?</p>
  
  <p>If this is not possible, I don't have an issue with the "Not Possible" answer. Though if you have a better method of solving this, other then the way I have described above, in the sake of being lazier, I would be interested in reading it :)</p>