I have a .csv file on my server that looks like this :
C:/Users/Server/Pictures/P1040805.JPG,0.163533
C:/Users/Server/Pictures/P1040808.JPG,0.170159
C:/Users/Server/Pictures/P1040819.JPG,0.885534
C:/Users/Server/Pictures/P1040825.JPG,0.11393
C:/Users/Server/Pictures/P1040826.JPG,0.0536503
and so on. I found a php script that displays these results in my browser which looks like this:
<?php
$row = 1;
if (($handle = fopen("C:/xampp/htdocs/results/result.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo " ","Record #",$row," "; $row++;
for ($recordcount=0; $recordcount < $num; $recordcount++) {
echo $data[$recordcount] . "
";
}
}
fclose($handle);
} ?>
But when it shows the csv, the layout is totally messed up, e.g several results in one line.
I'd like to do three things -
-convert the 0.xx to a percentage -put the percentage value in the first column and the path in the second -and most of all, simply have the data stacked neatly so that every line has one result.
Can that all be done in php? and could somebody tell me what parameter I have to tweak to get one result per line and not more?