Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get data from csv file in php and print in table

<!DOCTYPE html>
<html>
  
<body>
    <center>
        <h1>DISPLAY DATA PRESENT IN CSV</h1>
        <h3>Student data</h3>
  
        <?php
        echo "<html><body><center><table>

";
  
        // Open a file
        $file = fopen("a.csv", "r");
  
        // Fetching data from csv file row by row
        while (($data = fgetcsv($file)) !== false) {
  
            // HTML tag for placing in row format
            echo "<tr>";
            foreach ($data as $i) {
                echo "<td>" . htmlspecialchars($i) 
                    . "</td>";
            }
            echo "</tr> 
";
        }
  
        // Closing the file
        fclose($file);
  
        echo "
</table></center></body></html>";
        ?>
    </center>
</body>
  
</html>
Comment

PREVIOUS NEXT
Code Example
Php :: model class not found in laravel 
Php :: insert into laravel 8 
Php :: alert message in blade template with() 
Php :: Download any version of xampp 
Php :: php apns notification source code 
Php :: laravel permission 
Php :: laravel route multiple middleware 
Php :: laravel 9 route group 
Php :: laravel create many 
Php :: random string number generator in php codeigniter 
Php :: python to php converter online 
Php :: spaceship operator php 
Php :: php docs comments 
Php :: SQLSTATE[42S02] lumen 
Php :: php webserver 
Php :: php sort time 
Php :: get_the_terms 
Php :: laravel composer create project 
Php :: firstOrFail() 
Php :: which programming languae does php resemble to? 
Php :: laravel admin panel free package 
Php :: wp_register_script 
Php :: disadvantages of php 
Php :: laravel form request exists 
Php :: how to set logo in wordpress 
Php :: copy file in php 
Php :: hex2bin (PHP 5 = 5.4.0, PHP 7, PHP 8) hex2bin — Decodes a hexadecimally encoded binary string 
Php :: laravel https middleware 
Php :: simple php round Passing parameters with mode 
Php :: how to get favicon with Goutte php 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =