sharptooth
sharptooth

Reputation: 170489

What does "at" symbol enclosed in quotes mean in PHP?

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?

Upvotes: 0

Views: 139

Answers (1)

John Conde
John Conde

Reputation: 219834

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

Upvotes: 4

Related Questions