Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2. /*
  3. $filename = 'Restoranai.csv';
  4.  
  5. $restoranumasyvas =[];
  6.  
  7. if (($h = fopen("$filename","r"))!== FALSE){
  8.  
  9. while(($data = fgetcsv($h, 1000, ",")) !== FALSE) {
  10.  
  11. $restoranumasyvas = $data;
  12.  
  13. }
  14. fclose($h);
  15. }
  16.  
  17. echo '<pre>';
  18. var_dump($restoranumasyvas);
  19. echo '</pre>';
  20. */
  21.  
  22.  
  23.  
  24.  
  25. $csvfile = file('Restoranai.csv');
  26. $Restoranumasyvas = [];
  27.  
  28. foreach ($csvfile as $line){
  29. $Restoranumasyvas[] = str_getcsv($line);
  30. }
  31. /*
  32. echo '<pre>';
  33. var_dump($Restoranumasyvas);
  34. echo '</pre>';
  35. */
  36.  
  37. function spausdintirestoranus($Restoranai)
  38. {
  39.  
  40. foreach ($Restoranai as $elementai) {
  41.  
  42. echo '<tr>';
  43.  
  44. echo '<th>';
  45. echo $elementai[0];
  46. echo '</th>';
  47. echo '<td>';
  48. echo '<img src="<?php echo $elementai[1]?>" alt="nerado logo">';
  49. echo '</td>';
  50. echo '<td>';
  51. echo $elementai[2];
  52. echo '</td>';
  53. echo '<td>';
  54. echo $elementai[3];
  55. echo '</td>';
  56.  
  57. echo '</tr>';
  58.  
  59. }
  60.  
  61. }
  62.  
  63.  
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement