web/tagging/loadtags.php
author ymh <ymh.work@gmail.com>
Mon, 03 May 2010 11:47:39 +0200
changeset 114 a8e80a8a239d
parent 2 65157edaee3e
permissions -rw-r--r--
Try to correct accented search problem

<?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;
?>