Hello everybody!
My problem start whit a xls file that i'm have to read and send the values to a mysql DB, well i'm convert the xls file to a csv file and i'm build some code to select the data and display it befor send it to the DB, my problem is the end of the line...
That becouse each converted "cell" is separeted whit ":" but when change the line no : is given or other charater, so i'm don't know how to detect the end of the line... 🙁
the code I'm using is this one:
<?php
$fo=fopen("teste.csv",r) or die ("deu erro!");
//$cont=1;
while (!feof($fo))
{
$letra=fgetc($fo);
//$cont ++;
//$letra[$cont]=fgetc($fo);
if ($letra=="\n")
{
echo "mudou de linha";
}
if ($letra<>":")
{
echo "<p>".$letra."</p>";
$palavra .=$letra;
}
else
{
echo "</br><p>esta é a palavra ".$palavra."</p></br>";
//$cont=1;
$palavra="";
}
}
fclose($fo);
?>
Well thanks everyone and i'm accept code changes!
see you