Add LICENSE and make it part of PECL tar
[phpyaz-moved-to-github.git] / client.php
1 <?php
2 $z = yaz_connect("localhost:9999");
3 yaz_range($z, 1, 2);
4 yaz_search($z,"rpn", "computer");
5 yaz_wait();
6 $error = yaz_error($z);
7 if (!empty($error)) {
8     echo "Error: $error\n";
9 } else {
10     $hits = yaz_hits($z);
11     echo "Result count $hits\n";
12     for ($p = 1; $p <= 2; $p++) {
13         $rec = yaz_record($z, $p, "string");
14         if (empty($rec)) break;
15         echo "----- $p -----\n$rec";
16     }
17 }
18 ?>