HEX
Server: Apache
System: Linux webm004.cluster129.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: windevelwb (110072)
PHP: 8.5.0
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/windevelwb/www/api2/liste.php
<?php
header("Content-Type: application/json; charset=utf-8");

// Charger les fichiers JSON
$macsFile = __DIR__ . "/data/macs.json";
$portalsFile = __DIR__ . "/data/portals.json";

// Lire les fichiers
$macs = file_exists($macsFile) ? json_decode(file_get_contents($macsFile), true) : [];
$portals = file_exists($portalsFile) ? json_decode(file_get_contents($portalsFile), true) : [];

// NE GARDER QUE 20 MACS
$macs = array_slice($macs, 0, 20);

// Structure JSON propre
$response = [
    "xtream" => isset($portals["xtream"]) ? $portals["xtream"] : [],
    "stalker" => isset($portals["stalker"]) ? $portals["stalker"] : [],
    "macs" => $macs
];

// Retour JSON propre
echo json_encode($response);