I would like to check if csv file contain a header and ignore the header.
I have to do a check if the first column is not a character
csv file has format : avgTemperature, minTemperature, maxTemperature
$f = fopen("./uploads/" .$filename, "r"); $string = "avgTemperature"; if (fgetcsv($f)==$string){ // read the first line and ignore it fgets($f); }
Going from your comment, and from the idea that the actual data is temperatures (i.e. numeric data), if you do have headers, then they will be text strings and not numbers. Therefore you can do something like this:
EDIT: An alternative version of the last loop would look like this: