-2

Is it possible to convert this curl command to PHP?

curl -F file=@filename https://any.website.com/

1 Answers1

0

Try With:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://any.website.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
Imran Khan
  • 311
  • 4
  • 9