Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get csv file from server folder in PHP

<?php

    $files = glob("$PathToCreate$version/*.csv");

    foreach($files as $file) {

        if (($handle = fopen($file, "r")) !== FALSE) {
            echo "<b>Filename: " . basename($file) . "</b><br><br>";
            while (($data = fgetcsv($handle, 4096, ",")) !== FALSE) {
                echo implode("	", $data);
            }
            echo "<br>";
            fclose($handle);
        } else {
            echo "Could not open file: " . $file;
        }

    }

?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #csv #file #server #folder #PHP
ADD COMMENT
Topic
Name
5+1 =