title: Laravel Exception: Both parameters should have an equal number of elements
body: <p>I'm new to laravel, and I'm making an app that need a .CSV data to be imported into the database, the data has been succesfully imported however i faced this issue :</p>
  
  <p><code>ErrorException array_combine(): Both parameters should have an equal number of elements</code></p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\Accounts;
  class AccountController extends Controller
  {
      public function show(){
          return view ('upload');
      }
      public function store(Request $request){
  
  
          $file = $request-&gt;file('upload-file');
          $csvData = file_get_contents($file);
  
          $rows = array_map("str_getcsv", explode("\n", $csvData));
      // dd($rows);
          $header = array_shift($rows);
  //    dd($header);
          foreach ($rows as $row) {
  
              $row = array_combine($header, $row);
              if (count($header) != count($row)) {
                  continue;
                }
              set_time_limit(0);
              Accounts::create([
                  'AccountClass' =&gt; $row['Classe'],
                  'AccountNumber' =&gt; $row['Compte'],
                  'AccountDesc' =&gt; $row['Desc'],
                  'active' =&gt; 1,
              ]);
          }
  
          return view ('home');
  
      }
  
  }
  </code></pre>
  
  <p>would you point me to the right direction thank you in advance </p>