2016-02-03 143 views
-2

我想知道,如何将linux curl命令转换为PHP。这是我的linux卷曲命令。提前致谢。将Linux Curl命令转换为PHP

curl -i -F api_password=<YOUR_API_PASSWORD> -F [email protected]<LOCAL_FILE_PATH> https://upload.wistia.com/ 
+1

你有没有尝试过的东西,什么? – Oxi

+1

不要浪费你的时间,我们为你编写php代码,从http://php.net/manual/en/curl.examples-basic.php开始,然后尝试你的自我,如果有任何问题,告诉我们。 –

回答

0

这里是你可以使用的出发点...

<?php 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_URL, $THE_REMOTE_URL_YOU_ARE_POSTING_TO); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
    "file" => "@c:\\file_location.txt", // note the double \\ when used within double quotes 
    'api_password' => 12345 
)); 
$response = curl_exec($ch); 
?> 
+0

感谢它的魅力 –