Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- $filename = 'Restoranai.csv';
- $restoranumasyvas =[];
- if (($h = fopen("$filename","r"))!== FALSE){
- while(($data = fgetcsv($h, 1000, ",")) !== FALSE) {
- $restoranumasyvas = $data;
- }
- fclose($h);
- }
- echo '<pre>';
- var_dump($restoranumasyvas);
- echo '</pre>';
- */
- $csvfile = file('Restoranai.csv');
- $Restoranumasyvas = [];
- foreach ($csvfile as $line){
- $Restoranumasyvas[] = str_getcsv($line);
- }
- /*
- echo '<pre>';
- var_dump($Restoranumasyvas);
- echo '</pre>';
- */
- function spausdintirestoranus($Restoranai)
- {
- foreach ($Restoranai as $elementai) {
- echo '<tr>';
- echo '<th>';
- echo $elementai[0];
- echo '</th>';
- echo '<td>';
- echo '<img src="<?php echo $elementai[1]?>" alt="nerado logo">';
- echo '</td>';
- echo '<td>';
- echo $elementai[2];
- echo '</td>';
- echo '<td>';
- echo $elementai[3];
- echo '</td>';
- echo '</tr>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement