title: if elseif indie while loop
body: <p>I am trying to handle a CSV file via php, and I have it working. But there is this one array that I need to change based on a set of conditions.</p>
  
  <pre><code>$file_handle = fopen($path, "r");
  while (!feof($file_handle) ) {
      $line_of_text = fgetcsv($file_handle, 100000);
      if($currency == "US"){
          $line_of_text[6] = str_replace ("if_you_find_this","change_to_this",$line_of_text[6]);
          $line_of_text[6] = str_replace ("if_you_find_this","change_to_this",$line_of_text[6]);
      } elseif($currency == "DE"){
          $line_of_text[6] = str_replace ("if_you_find_this","change_to_this",$line_of_text[6]);
          $line_of_text[6] = str_replace ("if_you_find_this","change_to_this",$line_of_text[6]);
  }else {
          echo "Something with currency handling went wrong. Please contact support.";
  }
      $data .=  $line_of_text[0] . "," . $line_of_text[1] . "," . $line_of_text[2] . "," . $line_of_text[4] . "," . $line_of_text[6] . "," .  $line_of_text[49] . "," .  $line_of_text[51] . "\n";
  
  }
  fclose($file_handle);
  
  $new_file_handle = fopen($path, "w");
  fwrite($new_file_handle, $data);
  </code></pre>
  
  <p>It's not throwing any errors, but seems that the whole conditional block is being ignored. Help?</p>