upload file with PHP | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

upload file with PHP

how to get the content of the upload csv files using the php?

23rd Jan 2018, 7:08 AM
Niazra Enano
Niazra Enano - avatar
4 Answers
+ 4
http://php.net It has a whole article about file uploading.
23rd Jan 2018, 7:13 AM
Freezemage
Freezemage - avatar
+ 2
that php script works out of the box: https://blueimp.github.io/jQuery-File-Upload/basic-plus.html (demo) built in security. just download to your ftp and access from domain name
23rd Jan 2018, 8:29 AM
Iaroslav Kalytiuk
Iaroslav Kalytiuk - avatar
+ 1
use file function of php
23rd Jan 2018, 8:32 AM
fahim
0
this code works on a single csv file only...but what i wanted to do is..every csv file I uploaded i can view the content of the specific file to another form. Anyone can help? <?php $csvFile = file('sample.csv'); foreach ($csvFile as $line) { $data[] = str_getcsv($line); } echo "<br /><br />"; $length = count($data); echo "<table border=1>"; echo "<thead>"; echo "<tr>"; foreach ($data[1] as $value) { echo "<td>"; echo $value; echo"</td>"; } echo "</tr>"; echo "</thead>"; echo "<tbody>"; for ($i=2; $i < $length; $i++) { echo "<tr>"; foreach ($data[$i] as $row) { echo "<td>"; echo $row; echo "</td>"; } echo "</tr>"; } echo "</tbody>"; echo "</table>"; ?>
23rd Jan 2018, 8:44 AM
Niazra Enano
Niazra Enano - avatar