new CURLFile($imageFile),
‘size’ => ‘auto’
]);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
‘X-Api-Key: ‘ . $apiKey
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200) {
$outputFile = “output_” . time() . “.png”;
file_put_contents($outputFile, $response);
echo “
Background Removed:
“;
echo “

“;
echo “
Download Image“;
} else {
echo “Error: ” . $response;
}
curl_close($ch);
} else {
echo “No file uploaded.”;
}
?>