-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex5.php
More file actions
38 lines (30 loc) · 1.01 KB
/
index5.php
File metadata and controls
38 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
# curl https://php.loadfunc.com/apifunc.php --output apifunc.php
# curl https://loadfunc.github.io/php/apifunc.php --output apifunc.php
include '.apifunc\\apifunc.php';
header('Content-Type: application/json');
# Webs service with JSON output
try {
# Load functions from remote/local
apifunc([
'https://php.letjson.com/let_json.php',
'https://php.defjson.com/def_json.php',
'https://php.apisql.com/api_sql.php',
'https://php.lettxt.com/let_txt.php'
], function () {
// Load config file from remote/local json file
let_json('db.json', function ($db) {
// load data from sqlite based on json configuration: config.json
api_sql($db->db, let_txt('.apisql/get_all_members.sql'), function ($fetch) {
// encode data to json
echo def_json('', $fetch);
});
});
});
} catch (exception $e) {
echo def_json('', [
'message' => $e->getMessage(),
'error' => true
]);
}
?>