在PHP中用引号括起来的“at”符号是什么意思?

在PHP中用引号括起来的“at”符号是什么意思?

问题描述:

I've got this code:

$filePath = '/blah/image.jpg';
$data_array = array(
  "file_data"=>"@".$filePath,
);

the $data_array = array construct is an array definition and "file_data"=>"@".$filePath, specifies an array element.

The array is then used for setting up an HTTP POST request:

curl_setopt($request, CURLOPT_POSTFIELDS, $data_array);

What does "@" in "@".$filePath mean?

我有这段代码: p>

  $ filePath =  '/blah/image.jpg';
$data_array = array(
“file_data”=>“@”。$ filePath,
); 
  code>  pre> 
 
   $ data_array = array  code>构造是一个数组定义,“file_data”=>“@”。$ filePath, code>指定一个数组元素。 p> \  n 
 

然后使用该数组设置HTTP POST请求: p>

  curl_setopt($ request,CURLOPT_POSTFIELDS,$ data_array); 
  code>   pre> 
 
 

“@”中的“@” code>。$ filePath code>是什么意思? p> div>

It's a literal @ sign being prepended to a string. The result is a value of @/blah/image.jpg