| author | ymh <ymh.work@gmail.com> |
| Mon, 05 Oct 2009 16:58:06 +0200 | |
| changeset 10 | d17aa71a58e0 |
| parent 2 | 65157edaee3e |
| permissions | -rw-r--r-- |
|
2
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
1 |
<?php |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
2 |
header("Content-type: text/x-json"); |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
3 |
$fp = fopen("tags.csv", "r"); |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
4 |
while (($data = fgetcsv($fp)) != FALSE) { |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
5 |
$line = "{sin: " . $data[0] . |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
6 |
",sout: " . $data[1] . |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
7 |
",tag: '" . $data[2] . "'" . |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
8 |
",user: '" . $data[3] . "'}"; |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
9 |
|
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
10 |
$lines[] = $line; |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
11 |
} |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
12 |
$result = "[" . join($lines,',') . "]"; |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
13 |
echo $result; |
|
65157edaee3e
Tagging proof of concept
Boris de Laage <bdelaage@universcine.com>
parents:
diff
changeset
|
14 |
?> |