title: Array to string conversion error in Yii2 console app
body: <p>Please tell me such a thing. There is a self-written site, the code works on it, when I transfer the same code to the yii2 console application, it will get an error converting an array to a string</p>
  <p>I will describe in more detail what is happening.</p>
  <p>There is a text file inside which the following.</p>
  <pre><code>5|02.10.2020 20:20|Name 1
  5|02.10.2020 22:25|Name 2
  </code></pre>
  <p>Day of the week, date and time, program name. It is necessary to add this case to the database.</p>
  <pre><code>    $data = iconv(&quot;windows-1251&quot;, &quot;UTF-8&quot;, file_get_contents( './import/' . $filename . '.txt' ) );
      $tv = explode(&quot;\n&quot;, $data);
  
      foreach ($tv as $line)
      {
      $ex1 = explode(&quot;|&quot;,$line);
      $ex2 = explode(&quot; &quot;,$ex1[1]);
      ... next insert to db $ex1[0] - day of week, $ex2[0] - date, $ex2[1] - time, $ex1[2] - name
      }
  </code></pre>
  <p>In a regular .php file, all this works, and when the same code is in yii2, it swears at conversion. Why is that? How to do it right?</p>
  <p>It turns out that it cannot use $ ex1 [0], $ ex2 [0] and so on as a string.</p>