21 lines
603 B
PHP
Executable File
21 lines
603 B
PHP
Executable File
<?php
|
|
|
|
if(preg_match('/^[^\?]+\?([^\&\/]+)[\&\/](.+)$/', $_SERVER["REQUEST_URI"], $matches)){
|
|
|
|
$data = [];
|
|
|
|
foreach(explode(",", $matches[2]) as $name)
|
|
if(
|
|
file_exists($file = __DIR__ . "/json/" . $matches[1] . "/" . $name . ".json") &&
|
|
($json = json_decode(file_get_contents($file), true))
|
|
)
|
|
$data = array_merge($data, $json);
|
|
|
|
header("content-type: application/json");
|
|
echo json_encode($data);
|
|
|
|
return;
|
|
};
|
|
|
|
echo file_get_contents(__DIR__ . "/index2.html");
|