web/tagging/loadtags.php
author ymh <ymh.work@gmail.com>
Mon, 05 Oct 2009 16:58:06 +0200
changeset 10 d17aa71a58e0
parent 2 65157edaee3e
permissions -rw-r--r--
finish project configuration

<?php
header("Content-type: text/x-json");
$fp = fopen("tags.csv", "r");
while (($data = fgetcsv($fp)) != FALSE) {
  $line = "{sin: " . $data[0] .
    ",sout: " . $data[1] .
    ",tag: '" . $data[2] . "'" .
    ",user: '" . $data[3] . "'}";

  $lines[] = $line;
}
$result = "[" . join($lines,',') . "]";
echo $result;
?>