title: How to read excel file and display data in Yii 2?
body: <p>I have tried to use PHPExcel library to read the excel file and display data from the file. But it was not working for me.</p>
  
  <p>I have also tried using <a href="https://github.com/AlexGx/yii2-phpexcel" rel="nofollow">yii2-phpexcel</a> extension also other some ways but nothing worked for me. I hope I would get help from the expert personnel.</p>
  
  <p>I have used PHPExcel in CakePHP to read data from excel but I have no idea how to make code workable in Yii 2. How can I load PHPExcel in Yii2? I am using XLSX. In CakePHP, I can use- </p>
  
  <pre><code>App::import('Vendor', 'Excel/reader'); 
  $data = new Spreadsheet_Excel_Reader();
  $data-&gt;setOutputEncoding('CP1251');
  $data-&gt;read(WWW_ROOT . 'uploads/' . $_FILES["filename"]["name"]);
  $cells = $data-&gt;sheets[0]['cells'];
  </code></pre>
  
  <p>Thanks in advance. </p>