[英]What does '$ch' and '-F' stand for in $ch = curl_init();
I'm using cURL in php. 我在php中使用cURL。 Noticed each time a curl case is initiated, people always put:
每次启动卷发盒时,人们都会注意到:
$ch=curl_init();
WHat does '$ch' mean? “ $ ch”是什么意思?
curl -F template_invoke_name='sendcloud_template'
What does '-F' mean? “ -F”是什么意思?
I've googled around with no answers so hoping to get some here. 我在Google周围搜索没有答案,希望能在这里找到答案。 Thanks!
谢谢!
When you call curl_init()
it initializes a new session and returns a cURL handle. 当您调用
curl_init()
它将初始化一个新会话并返回一个cURL句柄。 $ch
is a variable to store the handle (I'm guessing in this instance that $ch
is a shortened version of curl handle
). $ch
是用于存储句柄的变量(在这种情况下,我猜$ch
是curl handle
的简化版本)。 Functions such as curl_setopt
require a curl handle to be passed in as an argument. 诸如
curl_setopt
函数需要将curl句柄作为参数传递。
Reference: http://se2.php.net/manual/en/function.curl-init.php 参考: http : //se2.php.net/manual/en/function.curl-init.php
$ch
is just some variable that holds the cURL handle returned by curl_init() , and -F refers to form content see, -F, --form . $ch
只是保存curl_init()返回的cURL句柄的某个变量,-F表示表单内容,请参见-F,--form 。 This lets curl emulate a filled-in form in which a user has pressed the submit button. 这使curl可以模拟用户按下提交按钮的填充表单。 This causes curl to POST data using the Content-Type multipart/form-data
这会导致使用Content-Type multipart / form-data卷曲到POST数据
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.