| Server IP : 80.211.21.168 / Your IP : 216.73.217.33 Web Server : Apache System : Linux alex-webdesign.it 3.10.0-1160.119.1.el7.tuxcare.els22.x86_64 #1 SMP Mon Aug 18 06:07:12 UTC 2025 x86_64 User : admin_japan ( 10003) PHP Version : 8.2.32 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/cerchijapan.it/ai4dealers.com/ |
Upload File : |
<?php
/**
* Confronta lead_fields.json con account_fields.json
* e stampa i campi che esistono solo nei lead.
*/
$leadFile = 'lead_fields.json';
$accountFile = 'account_fields.json';
// 1. Carica e decodifica i file JSON.
$leadFields = json_decode(file_get_contents($leadFile), true);
$accountFields = json_decode(file_get_contents($accountFile), true);
if (!is_array($leadFields) || !is_array($accountFields)) {
fwrite(STDERR, "Errore: impossibile leggere o decodificare i file JSON.\n");
exit(1);
}
// 2. Trova i campi presenti nei lead ma non negli account.
$onlyInLead = array_values(array_diff($leadFields, $accountFields));
// 3. Stampa il risultato in JSON “pretty”.
echo json_encode($onlyInLead, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;