0

This loop here takes too long to be executed. Does it mean I am getting into an infinite loop? How can I fix it ? it is suppose to be reading from a csv file and storing them into an array then outputting them into a table

while($quote = fgetcsv($csf_symb) != false)
{
    $temp;
    if ($quote[2] !="N/A" || $quote[2] != "0.00")
    {
        $temp["symbol"] = $quote[0];
        $temp["name"] = $quote[1];
        $temp["price"] = number_format($name = $quote[2],4);
        $temp["change"] = number_format($name = $quote[3],4);
        $temp["percent"] = $quote[4];
        $temp["low"] = number_format($name = $quote[5],4);
        $temp["high"] = number_format($name = $quote[6],4);
        $table = $table . "<tr>"; 
        foreach($temp as $element)
        {
            $table = $table . "<td>" . $element . "</td>";
        }
        $table = $table . "</tr>" ; 
    }
}
2
  • How big is that CSV file? Sep 13 '16 at 22:56
  • Not too big. about 13 columns and 8 rows. I tried to run a constant loop that runs 13 times exactly.It ran smoothly. The issue seems to be with recognizing the End of File. How can I solve it?
    – A.Emad
    Sep 14 '16 at 12:58

You must log in to answer this question.

Browse other questions tagged .