title: Unexpected '+' Error. Expected ']' in accessing indices of an array
body: <p>I have some php code where I look into a file, read till EOF then use a PHP script to insert them into a mysql database. Here's the code:</p>
  
  <pre><code>$array = array();
  while(!feof($filehandle)) {
          $line = fgets($filehandle);
          array_push($array, $line);
  }
  $i = 0;
  while($i &lt; count($array)-1) {
          $insert = mysqli_query( $dbhandle, "INSERT INTO " . $table_name . "(column1, column2, column3) VALUES ('$array[$i]' , '$array[$i+1]', '$array[$i+2]')");
          $i += 3;
  }
  </code></pre>
  
  <p>When I run this, it has an error at my <code>mysqli_query</code> line <code>syntax error, unexpected '+', expecting ']'</code></p>
  
  <p>I've tried to do string concatenation:
  <code>'$array[$i]' ,'".$array[$i+1]." ,</code> 
  and this runs without an error, but the data isn't popping up in my db. </p>
  
  <p>As a temp solution, I have <code>$j = $i + 1</code> and <code>$k = $i + 1</code> which i use to index my array, and seems to work fine...</p>
  
  <p>Any idea what is going on here? Thanks in advance.</p>