title: Array key = variable name
body: <p>I have an array like this:</p>
  
  <pre><code>$data = array(
    "ID" =&gt; 1,
    "NAME" =&gt; "John Doe",
    "DATE" =&gt; date("d.m.Y H:i:s")
  );
  </code></pre>
  
  <p>I want to create new variables with the name of the key and the value of the key like this:</p>
  
  <pre><code>$id = 1; 
  $name = "John Doe";
  $date = "17.11.2016 00:00:00";
  </code></pre>
  
  <p>I would like to do this with in for each loop, my current code looks like this:</p>
  
  <pre><code>foreach ($data as $key =&gt; $value) {
  
      $key = $data[$key];
  
  }
  </code></pre>