title: Key/Value pair as variable in PHP
body: <p>I'm have parsed a csv file into a associative array which looks like this:</p>
  <pre><code>array(5) {
  [0]=&gt;  array(13) { 
              [&quot;First Name&quot;]=&gt;string(7) &quot;Name&quot;
              [&quot;Last Name&quot;]=&gt;string(14) &quot;Last name&quot;
              [&quot;Login&quot;]=&gt;string(22) &quot;name.lastname&quot;
              [&quot;Email&quot;]=&gt;string(27) &quot;email&quot;
  …
  </code></pre>
  <p>I now want to write the value of each key into a variable with the name of the key, e.g.:</p>
  <pre><code>$FirstName = &quot;Name&quot;;
  $LastName = &quot;Last name&quot;;
  </code></pre>
  <p>As I am relatively new to programming and php I am struggling with this and I hope that you can give me a hint </p>
  <p>Edit: This is how I create the array:</p>
  <pre><code>function csv_to_array($filename='', $delimiter=';')
  {
      if(!file_exists($filename) || !is_readable($filename))
          return FALSE;
  
      $header = NULL;
      $data = array();
      if (($handle = fopen($filename, 'r')) !== FALSE)
      {
          while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE)
          {
              if(!$header)
                  $header = $row;
              else
                  $data[] = array_combine($header, $row);
          }
          fclose($handle);
      }
      return $data;
  }
  
  $a_csv = csv_to_array($file, ';');
  </code></pre>