How can I translate this curl command so that it works in a PHP script?
curl --request POST --data-binary \'@import.xml\' --header \"Content-Type: applicatio
Try this:
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/atom+xml'
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'http://siteurl.com');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents($filename));
curl_exec($ch);