title: possible to initialize a PHP array with keys only?
body: <p>I'm just looking for a MORE eloquent way of defining an array of empty error strings for a mail form then this...</p>
  
  <pre><code> $err = array('NAME'=&gt;'', 'EMAIL'=&gt;'', 'ADDR'=&gt;'', 'CS_LOC'=&gt;'', 'ZIP'=&gt;'','PHONE'=&gt;'', 'COMMENTS'=&gt;'', 'FILE'=&gt; '');
  </code></pre>
  
  <p>Since I have to flush these occasionally anyway, certainly anytime the form posts, I've already set up a function like the below which I call as needed, like this.</p>
  
  <pre><code>    function clearFormErrors(&amp;$ary) { // fill error array with empty strings
     $keys = array_keys($ary);
     $filled = array_fill_keys($keys, '');
     }        
  </code></pre>
  
  <p>Not a big deal <strong>[EDIT]:, but since I'm going to call this anyway, it would be nice if there were some nice 'wishlist' way I could just define the array **KEYS</strong> when I declare it**, like this...</p>
  
  <pre><code>$err = array('NAME', 'EMAIL, 'ADDR', 'CS_LOC, 'ZIP,'PHONE', 'COMMENTS, 'FILE');
  </code></pre>
  
  <p>Of course the above does NOT have that desired effect. <strong>I'm just curious if there is some simple directive or method that I've missed in the PHP docs that would just let me define the keys (with or without some default type)</strong>. I'm sure there is a more complicated function that could be created to build a new array using the keys (now values) from my above 'wishlist' array, but it sounds like it wouldn't make the code any shorter or more 'eloquent', right?   </p>