['ignore_errors' => true]]); $models_json = file_get_contents($api_url, false, $context); if ($models_json === false) { $errors[] = "Failed to fetch data from the API endpoint ($api_url). The server might be down or the URL is incorrect."; } else { $models_data = json_decode($models_json, true); if (json_last_error() !== JSON_ERROR_NONE) { $errors[] = "Failed to decode JSON. Error: " . json_last_error_msg(); $errors[] = "Received response: " . htmlspecialchars(substr($models_json, 0, 500)); // Show first 500 chars of response } else { $models = $models_data['models'] ?? []; $errors = array_merge($errors, $models_data['errors'] ?? []); } } ?>

Virtual Try-On

Something went wrong:

Caps

Cap

Shirts

Shirt

Pants

Pants
LAG
$model): ?> Model <?php echo $index + 1; ?>
Selected Model

Models could not be loaded. Please check the error messages above.