= count($rows) || $limit < 0) { header("HTTP/1.1 400 Bad Request"); echo "sn.start and/or sn.limit out of range"; exit(0); } $slice = array_slice($rows, $start, $limit); header("Content-type: application/javascript"); echo $prefix . "(["; $out_rows = array("[" . join(", ", $field_names) . "]"); foreach($slice as $r) { $out_rows[] = "[" . join(", ", $r) . "]"; } echo join(", ", $out_rows); echo "])"; } ?>