-
Notifications
You must be signed in to change notification settings - Fork 1
/
guest_notes.php
33 lines (33 loc) · 981 Bytes
/
guest_notes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
ini_set('auto_detect_line_endings', true);
$row = 1;
if (($handle = fopen("guestbook.csv", "r")) !== false) {
$i = 1;
while(!feof($handle)){
$tmp = fgetcsv($handle)[0];
if (feof($handle))
break;
echo "rekord ".$i++."<br>";
echo "imie - ".fgetcsv($handle)[0]."<br>";
echo "email - ".fgetcsv($handle)[0]."<br>";
echo "data - ".fgetcsv($handle)[0]."<br>";
$comments = fgetcsv($handle);
foreach ($comments as $lines)
echo $lines."<br>";
//if(feof($handle)) break;
}/*
while (($data = fgetcsv($handle)) !== false) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
echo $data[0]."<br>";
echo $data[1]."<br>";
echo $data[2]."<br>";
$len = count($data[3]);
for ($i=0; $i < $len; $i++) {
echo $data[3][$i] . "<br />\n";
}
}*/
fclose($handle);
}
?>