PHP - Upload a CSV file & print specific rows
Get the solution ↓↓↓Solution:
Actually, I did figured out with this, by looping, setting and echoing the variables. I still don't know if it's the best way of doing it but it actually works :
$row = 1;
if (($handle = fopen("upload/" . $storagename, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
$kilometrage = $data[11];
$stationnement = $data[12];
$perdiem = $data[13];
$depenses = $data[14];
for ($c=0; $c < 1; $c++) {
echo "<table style='min-width:1000px;'><tbody><tr>";
echo "<td style='width:25%'>" . $kilometrage . "</td>";
echo "<td style='width:25%'>" . $stationnement . "</td>";
echo "<td style='width:25%'>" . $perdiem . "</td>";
echo "<td style='width:25%'>" . $depenses . "</td>";
echo "</tr></tbody></table>";
}
}
fclose($handle);
}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: to enable extensions, verify that they are enabled in your .ini files
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.